Commit 1dcdc47e authored by David Byers's avatar David Byers
Browse files

Update unreads in membership buffer. Position cursor correctly at end of command.

Detailed changes:
> 2004-07-19  David Byers  <byers@lysator.liu.se>
>
> 	Nicen up lyskom-end-of-command:
> 	* command.el (def-kom-command): Use make-symbol, not intern, to
> 	get an uninterned symbol for the macro. Added winsym to save
> 	selected window.
> 	(def-kom-emacs-command): Ditto.
> 	(def-kom-command): Select the correct window for
> 	lyskom-end-of-command so point can be moved to the end of the
> 	prompt in that window.
> 	(def-kom-emacs-command): Same here.
>
> 	Fix problem tracking unreads in membership buffer:
> 	* clienttypes.el (read-list-enter-text): When updating unreads,
> 	pass conf-no, not conf-stat, to lp--maybe-update-unreads.
>
parent bec35a53
2004-07-19 David Byers <byers@lysator.liu.se>
Nicen up lyskom-end-of-command:
* command.el (def-kom-command): Use make-symbol, not intern, to
get an uninterned symbol for the macro. Added winsym to save
selected window.
(def-kom-emacs-command): Ditto.
(def-kom-command): Select the correct window for
lyskom-end-of-command so point can be moved to the end of the
prompt in that window.
(def-kom-emacs-command): Same here.
Fix problem tracking unreads in membership buffer:
* clienttypes.el (read-list-enter-text): When updating unreads,
pass conf-no, not conf-stat, to lp--maybe-update-unreads.
2004-07-18 David Byers <byers@lysator.liu.se>
* mship-edit.el (lp--maybe-update-unreads): Zero unreads are
......
......@@ -172,7 +172,7 @@ Returns t if there was a conference to insert this text into."
(conf-stat->conf-no (read-info->conf-stat read-info))))
(read-info-enter-text-last read-info text-no)
(setq inserted t))))
(when inserted (lp--maybe-update-unreads recipient))
(when inserted (lp--maybe-update-unreads (conf-stat->conf-no recipient)))
inserted))
......
......@@ -104,13 +104,15 @@ Note that :prompt-format requires an argument."
(progn (message "!! Missing interactive declaration for %S; assuming \(interactive\)" cmd)
(setq forms (cons interactive-decl forms))
(setq interactive-decl '(interactive))))
(let ((bufsym (intern (format "%S-start-buffer" cmd))))
(let ((bufsym (make-symbol (format "%S-start-buffer" cmd)))
(winsym (make-symbol (format "%S-start-window" cmd))))
`(defun ,cmd ,args
,doc
,(lyskom-fix-interactive-decl interactive-decl cmd)
(let ((lyskom-command-point (point)))
(lyskom-start-of-command ',cmd ,may-interrupt ,dead-ok ,prompt-format)
(let ((,bufsym (current-buffer)))
(let ((,bufsym (current-buffer))
(,winsym (selected-window)))
(unwind-protect
(condition-case nil
(progn ,@forms)
......@@ -118,9 +120,20 @@ Note that :prompt-format requires an argument."
(lyskom-insert-before-prompt
(lyskom-get-string 'interrupted))))
(lyskom-save-excursion
(when (buffer-live-p ,bufsym)
(set-buffer ,bufsym))
(lyskom-end-of-command)))))))))
(cond ((and (buffer-live-p ,bufsym)
(window-live-p ,winsym)
(eq (window-buffer ,winsym) ,bufsym))
(save-selected-window
(set-buffer ,bufsym)
(select-window ,winsym)
(lyskom-end-of-command)))
((buffer-live-p ,bufsym)
(set-buffer ,bufsym)
(lyskom-end-of-command))
(t (lyskom-end-of-command)))))))))))
;;
;; def-kom-emacs-command works like def-kom-command, but the template
......@@ -178,7 +191,8 @@ Note that :prompt-format requires an argument."
(setq interactive-decl '(interactive))))
(let ((rsym (intern (format "%S-running-as-kom-command" cmd)))
(bufsym (intern (format "%S-start-buffer" cmd))))
(bufsym (make-symbol (format "%S-start-buffer" cmd)))
(winsym (make-symbol (format "%S-start-window" cmd))))
`(defun ,cmd ,args
,doc
,(lyskom-fix-interactive-decl interactive-decl cmd)
......@@ -187,7 +201,8 @@ Note that :prompt-format requires an argument."
(progn (lyskom-start-of-command ',cmd ,may-interrupt ,dead-ok ,prompt-format)
(setq ,rsym t))
(error nil))
(let ((,bufsym (current-buffer)))
(let ((,bufsym (current-buffer))
(,winsym (selected-window)))
(unwind-protect
(condition-case nil
(progn ,@forms)
......@@ -196,10 +211,19 @@ Note that :prompt-format requires an argument."
(lyskom-get-string 'interrupted))))
(and ,rsym
(lyskom-save-excursion
(when (buffer-live-p ,bufsym)
(set-buffer ,bufsym))
(lyskom-end-of-command))))))))))
(cond ((and (buffer-live-p ,bufsym)
(window-live-p ,winsym)
(eq (window-buffer ,winsym) ,bufsym))
(save-selected-window
(set-buffer ,bufsym)
(select-window ,winsym)
(lyskom-end-of-command)))
((buffer-live-p ,bufsym)
(set-buffer ,bufsym)
(lyskom-end-of-command))
(t (lyskom-end-of-command))))))))))))
(put 'def-kom-command 'edebug-form-spec
......
......@@ -3090,7 +3090,8 @@ Set lyskom-current-prompt accordingly. Tell server what I am doing."
(delete-region (point) (match-end 0))
(delete-region (point) (point-max))
(if saved-suffix (insert saved-suffix)))))
(if was-at-max (goto-char (point-max)))
(when was-at-max
(goto-char (point-max)))
(setq lyskom-current-prompt prompt)
(setq lyskom-current-prompt-args prompt-args)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment