riece-update-buffer-functions.
(riece-user-list-mode): Ditto.
* riece-globals.el (riece-channel-indicator): Rename from
riece-short-channel-indicator.
(riece-long-channel-indicator): Rename from
riece-channel-indicator.
* riece-display.el (riece-update-buffer-functions): Default to
nil.
(riece-update-indicator-functions): New variable splitted from
riece-update-buffer-functions.
(riece-update-channel-indicator): Rename from
riece-update-short-channel-indicator.
(riece-update-long-channel-indicator): Rename from
riece-update-channel-indicator.
(riece-update-buffers): Don't set riece-channel-buffer.
(riece-switch-to-channel): Set riece-channel-buffer here.
* riece-button.el (riece-user-button-popup-menu): Change order.
(riece-button-update-buffer): Unify
riece-button-update-channel-list-buffer and
riece-button-update-user-list-buffer.
2003-10-13 Daiki Ueno <ueno@unixuser.org>
+ * riece.el (riece-channel-list-mode): Initialize
+ riece-update-buffer-functions.
+ (riece-user-list-mode): Ditto.
+
+ * riece-globals.el (riece-channel-indicator): Rename from
+ riece-short-channel-indicator.
+ (riece-long-channel-indicator): Rename from
+ riece-channel-indicator.
+
+ * riece-display.el (riece-update-buffer-functions): Default to
+ nil.
+ (riece-update-indicator-functions): New variable splitted from
+ riece-update-buffer-functions.
+ (riece-update-channel-indicator): Rename from
+ riece-update-short-channel-indicator.
+ (riece-update-long-channel-indicator): Rename from
+ riece-update-channel-indicator.
+ (riece-update-buffers): Don't set riece-channel-buffer.
+ (riece-switch-to-channel): Set riece-channel-buffer here.
+
+ * riece-button.el (riece-user-button-popup-menu): Change order.
+ (riece-button-update-buffer): Unify
+ riece-button-update-channel-list-buffer and
+ riece-button-update-user-list-buffer.
+
+2003-10-13 Daiki Ueno <ueno@unixuser.org>
+
* riece-history.el (riece-history-insinuate): In
riece-after-switch-to-channel-functions, check whether the last
channel is nil.
(defconst riece-user-button-popup-menu
'("User"
+ ["Finger (WHOIS)" riece-user-button-finger]
["Start Private Conversation" riece-user-button-join-partner]
["Give Channel Operator Privileges" riece-user-button-set-operators]
- ["Allow To Speak" riece-user-button-set-speakers]
- ["Finger (WHOIS)" riece-user-button-finger])
+ ["Allow To Speak" riece-user-button-set-speakers])
"Menu for user buttons.")
(defvar help-echo-owns-message)
(list 'local-map riece-identity-button-map
'keymap riece-identity-button-map))))))
-(defun riece-button-update-channel-list-buffer ()
- (save-excursion
- (set-buffer riece-channel-list-buffer)
- (riece-button-add-identity-button (point-min) (point-max))))
-
-(defun riece-button-update-user-list-buffer ()
- (save-excursion
- (set-buffer riece-user-list-buffer)
- (riece-button-add-identity-button (point-min) (point-max))))
+(defun riece-button-update-buffer ()
+ (riece-button-add-identity-button (point-min) (point-max)))
(defun riece-button-requires ()
'(riece-highlight))
(defvar riece-user-list-mode-map)
(defvar riece-dialogue-mode-map)
(defun riece-button-insinuate ()
- (add-hook 'riece-update-buffer-functions
- 'riece-button-update-channel-list-buffer t)
- (add-hook 'riece-update-buffer-functions
- 'riece-button-update-user-list-buffer t)
(add-hook 'riece-channel-list-mode-hook
(lambda ()
(set-keymap-parent riece-channel-list-mode-map widget-keymap)
(set (make-local-variable 'riece-identity-button-map)
- (riece-make-identity-button-map))))
+ (riece-make-identity-button-map))
+ (add-hook 'riece-update-buffer-functions
+ 'riece-button-update-buffer t t)))
(add-hook 'riece-user-list-mode-hook
(lambda ()
(set-keymap-parent riece-user-list-mode-map widget-keymap)
(set (make-local-variable 'riece-identity-button-map)
- (riece-make-identity-button-map))))
+ (riece-make-identity-button-map))
+ (add-hook 'riece-update-buffer-functions
+ 'riece-button-update-buffer t t)))
(add-hook 'riece-dialogue-mode-hook
(lambda ()
(set-keymap-parent riece-dialogue-mode-map widget-keymap)
(require 'riece-misc)
(require 'riece-layout)
-(defvar riece-update-buffer-functions
- '(riece-update-user-list-buffer
- riece-update-channel-list-buffer
- riece-update-status-indicators
+(defvar riece-update-buffer-functions nil
+ "Functions to redisplay the buffer.
+Local to the buffer in `riece-buffer-list'.")
+
+(defvar riece-update-indicator-functions
+ '(riece-update-status-indicators
riece-update-channel-indicator
- riece-update-short-channel-indicator
- riece-update-channel-list-indicator))
+ riece-update-long-channel-indicator
+ riece-update-channel-list-indicator)
+ "Functions to update modeline indicators.")
(defun riece-update-user-list-buffer ()
(save-excursion
(defun riece-update-channel-indicator ()
(setq riece-channel-indicator
(if riece-current-channel
+ (riece-format-identity riece-current-channel)
+ "None")))
+
+(defun riece-update-long-channel-indicator ()
+ (setq riece-long-channel-indicator
+ (if riece-current-channel
(if (riece-channel-p (riece-identity-prefix riece-current-channel))
(riece-concat-channel-modes
riece-current-channel
(riece-format-identity riece-current-channel))
"None")))
-(defun riece-update-short-channel-indicator ()
- (setq riece-short-channel-indicator
- (if riece-current-channel
- (riece-format-identity riece-current-channel)
- "None")))
-
(defun riece-update-channel-list-indicator ()
(if (and riece-current-channels
;; There is at least one channel.
"F"
"-")))))
-(defun riece-update-buffers ()
- (if riece-current-channel
- (setq riece-channel-buffer (get-buffer (riece-channel-buffer-name
- riece-current-channel))))
- (run-hooks 'riece-update-buffer-functions)
+(defun riece-update-buffers (&optional buffers)
+ (unless buffers
+ (setq buffers riece-buffer-list))
+ (while buffers
+ (save-excursion
+ (set-buffer (car buffers))
+ (run-hooks 'riece-update-buffer-functions))
+ (setq buffers (cdr buffers)))
+ (run-hooks 'riece-update-indicator-functions)
(force-mode-line-update t))
(defun riece-channel-buffer-name (identity)
(defun riece-switch-to-channel (identity)
(let ((last riece-current-channel))
- (setq riece-current-channel identity)
+ (setq riece-current-channel identity
+ riece-channel-buffer (get-buffer (riece-channel-buffer-name
+ riece-current-channel)))
(run-hook-with-args 'riece-after-switch-to-channel-functions last)))
(defun riece-join-channel (identity)
;;; Modeline indicators:
(defvar riece-channel-indicator "None"
"A modeline indicator of the current channel.")
+(defvar riece-long-channel-indicator "None"
+ "A modeline indicator of the current channel.")
(defvar riece-channel-list-indicator "No channel"
"A modeline indicator of the current joined channels.")
-(defvar riece-short-channel-indicator "None"
- "A modeline indicator of the current channel.")
(defvar riece-user-indicator nil)
(defvar riece-away-indicator "-")
riece-current-channels nil
riece-current-channel nil
riece-user-indicator nil
- riece-channel-indicator "None"
+ riece-long-channel-indicator "None"
riece-channel-list-indicator "No channel"
riece-away-indicator "-"
riece-operator-indicator "-"
" "
riece-user-indicator
" "
- riece-short-channel-indicator)))
+ riece-channel-indicator)))
(riece-simplify-mode-line-format)
(use-local-map riece-command-mode-map)
riece-operator-indicator
riece-freeze-indicator
" "
- riece-channel-indicator))))
+ riece-long-channel-indicator))))
(defun riece-channel-list-mode ()
"Major mode for displaying channel list.
(riece-mode-line-buffer-identification '("Riece: "))
truncate-lines t
buffer-read-only t)
+ (make-local-hook 'riece-update-buffer-functions)
+ (add-hook 'riece-update-buffer-functions
+ 'riece-update-channel-list-buffer nil t)
(use-local-map riece-channel-list-mode-map)
(run-hooks 'riece-channel-list-mode-hook))
mode-name "User list"
mode-line-buffer-identification
(riece-mode-line-buffer-identification
- '("Riece: " riece-channel-indicator " "))
+ '("Riece: " riece-long-channel-indicator " "))
truncate-lines t
buffer-read-only t)
(if (boundp 'transient-mark-mode)
(set (make-local-variable 'transient-mark-mode) t))
+ (make-local-hook 'riece-update-buffer-functions)
+ (add-hook 'riece-update-buffer-functions
+ 'riece-update-user-list-buffer nil t)
(use-local-map riece-user-list-mode-map)
(run-hooks 'riece-user-list-mode-hook))