* riece-display.el (riece-inhibit-update-buffers): New variable.
authorueno <ueno>
Sun, 22 Jun 2003 08:54:03 +0000 (08:54 +0000)
committerueno <ueno>
Sun, 22 Jun 2003 08:54:03 +0000 (08:54 +0000)
* 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.

lisp/ChangeLog
lisp/riece-commands.el
lisp/riece-display.el
lisp/riece-filter.el
lisp/riece-identity.el
lisp/riece-unread.el

index d45070d..6afb132 100644 (file)
@@ -1,3 +1,23 @@
+2003-06-22  Daiki Ueno  <ueno@unixuser.org>
+
+       * 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  <ueno@unixuser.org>
 
        * riece-naming.el (riece-naming-assert-join): Call
index ff64843..cafdf3c 100644 (file)
@@ -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
index 1f80e57..2ed58fb 100644 (file)
 (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
   :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
       (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)))
            (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))
index 088ee15..1631146 100644 (file)
                   (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
index 7a08a7a..f56e62c 100644 (file)
@@ -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)))
index 97e165e..8a856e2 100644 (file)
          (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