From: ueno Date: Sun, 22 Jun 2003 08:54:03 +0000 (+0000) Subject: * riece-display.el (riece-inhibit-update-buffers): New variable. X-Git-Tag: strict-naming-mergepoint~9 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=5596939aed16c14260960acb6002ad6275ef868a;p=elisp%2Friece.git * riece-display.el (riece-inhibit-update-buffers): New variable. * riece-filter.el (riece-sentinel): Bind riece-inhibit-update-buffers while removing channels from riece-current-channels. * riece-unread.el (riece-unread-display-message-function): Don't update channel list buffer when riece-inhibit-update-buffers is non-nil. (riece-unread-channel-switch-hook): Ditto. (riece-unread-insinuate): Add riece-unread-update-channel-list-buffer to riece-update-buffer-functions. * riece-commands.el (riece-command-switch-to-channel): Call riece-redisplay-buffers instead of riece-command-configure-windows. * riece-identity.el (riece-completing-read-identity): Remove nil from riece-current-channels before converting it to an alist. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d45070d..6afb132 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,23 @@ +2003-06-22 Daiki Ueno + + * riece-display.el (riece-inhibit-update-buffers): New variable. + * riece-filter.el (riece-sentinel): Bind + riece-inhibit-update-buffers while removing channels from + riece-current-channels. + * riece-unread.el (riece-unread-display-message-function): Don't + update channel list buffer when riece-inhibit-update-buffers is + non-nil. + (riece-unread-channel-switch-hook): Ditto. + (riece-unread-insinuate): Add + riece-unread-update-channel-list-buffer to + riece-update-buffer-functions. + + * riece-commands.el (riece-command-switch-to-channel): Call + riece-redisplay-buffers instead of riece-command-configure-windows. + + * riece-identity.el (riece-completing-read-identity): Remove nil + from riece-current-channels before converting it to an alist. + 2003-06-12 Daiki Ueno * riece-naming.el (riece-naming-assert-join): Call diff --git a/lisp/riece-commands.el b/lisp/riece-commands.el index ff64843..cafdf3c 100644 --- a/lisp/riece-commands.el +++ b/lisp/riece-commands.el @@ -38,7 +38,7 @@ (interactive (list (riece-completing-read-identity "Channel/User: " riece-current-channels nil t))) (riece-switch-to-channel channel) - (riece-command-configure-windows)) + (riece-redisplay-buffers)) (defun riece-command-switch-to-channel-by-number (number) (interactive diff --git a/lisp/riece-display.el b/lisp/riece-display.el index 1f80e57..2ed58fb 100644 --- a/lisp/riece-display.el +++ b/lisp/riece-display.el @@ -28,14 +28,6 @@ (require 'riece-channel) (require 'riece-misc) -(defvar riece-update-buffer-functions - '(riece-update-user-list-buffer - riece-update-channel-list-buffer - riece-update-status-indicators - riece-update-channel-indicator - riece-update-short-channel-indicator - riece-update-channel-list-indicator)) - (defcustom riece-configure-windows-function #'riece-configure-windows "Function to configure windows." :type 'function @@ -47,6 +39,18 @@ :type 'function :group 'riece-looks) +(defvar riece-update-buffer-functions + '(riece-update-user-list-buffer + riece-update-channel-list-buffer + riece-update-status-indicators + riece-update-channel-indicator + riece-update-short-channel-indicator + riece-update-channel-list-indicator)) + +(defvar riece-inhibit-update-buffers nil + "Non-nil means disregard update request of buffers. +Typically, this variable is bound to a let form.") + (defun riece-configure-windows () (let ((buffer (window-buffer)) (show-user-list @@ -221,8 +225,7 @@ (setq riece-channel-buffer (get-buffer (riece-channel-buffer-name riece-current-channel)))) (run-hooks 'riece-update-buffer-functions) - (force-mode-line-update t) - (run-hooks 'riece-update-buffers-hook)) + (force-mode-line-update t)) (defun riece-channel-buffer-name (identity) (format riece-channel-buffer-format (riece-decode-identity identity))) @@ -290,7 +293,8 @@ (setq buffers (cdr buffers)))))))) (defun riece-redisplay-buffers (&optional force) - (riece-update-buffers) + (unless riece-inhibit-update-buffers + (riece-update-buffers)) (if (or force (funcall riece-configure-windows-predicate)) (funcall riece-configure-windows-function)) diff --git a/lisp/riece-filter.el b/lisp/riece-filter.el index 088ee15..1631146 100644 --- a/lisp/riece-filter.el +++ b/lisp/riece-filter.el @@ -152,14 +152,15 @@ (substring status 0 (1- (length status)))) (message "Connection to \"%s\" closed: %s" server-name (substring status 0 (1- (length status)))))) - (let ((channels riece-current-channels)) + (let ((channels riece-current-channels) + (riece-inhibit-update-buffers t)) (while channels (if (and (car channels) (equal (riece-identity-server (car channels)) server-name)) (riece-part-channel (car channels))) - (setq channels (cdr channels))) - (riece-redisplay-buffers)) + (setq channels (cdr channels)))) + (riece-redisplay-buffers) (riece-close-server-process process) ;; If no server process is available, exit. (unless riece-process-list diff --git a/lisp/riece-identity.el b/lisp/riece-identity.el index 7a08a7a..f56e62c 100644 --- a/lisp/riece-identity.el +++ b/lisp/riece-identity.el @@ -151,9 +151,10 @@ RFC2812, 2.2 \"Character codes\" says: (let* ((decoded (completing-read prompt - (delq nil (mapcar (lambda (channel) - (list (riece-decode-identity channel))) - (or channels riece-current-channels))) + (mapcar (lambda (channel) + (list (riece-decode-identity channel))) + (delq nil (copy-sequence (or channels + riece-current-channels)))) predicate must-match)) (encoded (riece-encode-identity decoded))) diff --git a/lisp/riece-unread.el b/lisp/riece-unread.el index 97e165e..8a856e2 100644 --- a/lisp/riece-unread.el +++ b/lisp/riece-unread.el @@ -42,13 +42,15 @@ (delete (riece-message-target message) riece-unread-channels)) (add-to-list 'riece-unread-channels (riece-message-target message)) - (riece-unread-update-channel-list-buffer))) + (unless riece-inhibit-update-buffers + (riece-unread-update-channel-list-buffer)))) (defun riece-unread-channel-switch-hook () (setq riece-unread-channels (delete riece-current-channel riece-unread-channels)) - (riece-unread-update-channel-list-buffer)) + (unless riece-inhibit-update-buffers + (riece-unread-update-channel-list-buffer))) (defun riece-unread-update-channel-list-buffer () (if riece-channel-list-buffer-mode @@ -85,8 +87,8 @@ 'riece-unread-display-message-function) (add-hook 'riece-channel-switch-hook 'riece-unread-channel-switch-hook) - (add-hook 'riece-update-buffers-hook - 'riece-unread-update-channel-list-buffer) + (add-hook 'riece-update-buffer-functions + 'riece-unread-update-channel-list-buffer t) (define-key riece-command-mode-map "\C-c\C-u" 'riece-unread-switch-to-channel) (define-key riece-dialogue-mode-map