+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
(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
(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))
(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
(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)))
(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
'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