From: ueno Date: Fri, 26 Aug 2005 08:09:18 +0000 (+0000) Subject: * riece.el (riece-command-mode): Set X-Git-Tag: channel-coding-branchpoint~55 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=9cd80a6c8b7fd590580df68b6e000968437ec0f1;p=elisp%2Friece.git * riece.el (riece-command-mode): Set riece-mode-line-buffer-identification. (riece-dialogue-mode): Ditto. (riece-channel-mode): Ditto. (riece-channel-list-mode): Ditto. (riece-user-list-mode): Ditto. * riece-icon.el (riece-icon-update-mode-line-buffer-identification): New function. (riece-icon-insinuate): Use it. (riece-icon-uninstall): Use it. * riece-globals.el (riece-mode-line-buffer-identification): New variable. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 800896a..5ea4355 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,20 @@ 2005-08-26 Daiki Ueno + * riece.el (riece-command-mode): Set + riece-mode-line-buffer-identification. + (riece-dialogue-mode): Ditto. + (riece-channel-mode): Ditto. + (riece-channel-list-mode): Ditto. + (riece-user-list-mode): Ditto. + * riece-icon.el + (riece-icon-update-mode-line-buffer-identification): New function. + (riece-icon-insinuate): Use it. + (riece-icon-uninstall): Use it. + * riece-globals.el (riece-mode-line-buffer-identification): New + variable. + +2005-08-26 Daiki Ueno + * Make add-ons uninstallable. * riece-xface.el (riece-xface-user-list-mode-hook): New function. diff --git a/lisp/riece-globals.el b/lisp/riece-globals.el index aa84072..57f97fa 100644 --- a/lisp/riece-globals.el +++ b/lisp/riece-globals.el @@ -148,6 +148,7 @@ Local to the channel buffers.") Local to the channel buffers.") ;;; Modeline indicators: +(defvar riece-mode-line-buffer-identification nil) (defvar riece-channel-indicator "None" "String displayed on the modeline to indicate the current channel.") (defvar riece-long-channel-indicator "None" diff --git a/lisp/riece-icon.el b/lisp/riece-icon.el index 73792d2..a417f91 100644 --- a/lisp/riece-icon.el +++ b/lisp/riece-icon.el @@ -320,11 +320,24 @@ Modify whole identification by side effect." (defvar riece-icon-original-mode-line-buffer-identification nil) +(defun riece-icon-update-mode-line-buffer-identification () + (let ((buffers riece-buffer-list)) + (save-excursion + (while buffers + (set-buffer (car buffers)) + (if (local-variable-p 'riece-mode-line-buffer-identification + (car buffers)) + (setq mode-line-buffer-identification + (riece-mode-line-buffer-identification + riece-mode-line-buffer-identification))) + (setq buffers (cdr buffers)))))) + (defun riece-icon-insinuate () (setq riece-icon-original-mode-line-buffer-identification (symbol-function 'riece-mode-line-buffer-identification)) (defalias 'riece-mode-line-buffer-identification #'riece-icon-modeline-buffer-identification) + (riece-icon-update-mode-line-buffer-identification) (add-hook 'riece-user-list-mode-hook 'riece-icon-user-list-mode-hook) (add-hook 'riece-channel-list-mode-hook @@ -333,6 +346,7 @@ Modify whole identification by side effect." (defun riece-icon-uninstall () (fset 'riece-mode-line-buffer-identification riece-icon-original-mode-line-buffer-identification) + (riece-icon-update-mode-line-buffer-identification) (save-excursion (set-buffer riece-user-list-buffer) (remove-hook 'riece-update-buffer-functions diff --git a/lisp/riece.el b/lisp/riece.el index 1a10069..2fe80de 100644 --- a/lisp/riece.el +++ b/lisp/riece.el @@ -393,21 +393,24 @@ For a list of the generic commands type \\[riece-command-generic] ? RET. (make-local-variable 'truncate-partial-width-windows) (setq truncate-partial-width-windows nil) + (make-local-variable 'riece-mode-line-buffer-identification) (setq riece-away-indicator "-" riece-operator-indicator "-" riece-channel-status-indicator "-" major-mode 'riece-command-mode mode-name "Command" + riece-mode-line-buffer-identification + '("Riece: " + riece-away-indicator + riece-operator-indicator + riece-channel-status-indicator + " " + riece-user-indicator + " " + riece-channel-indicator) mode-line-buffer-identification (riece-mode-line-buffer-identification - '("Riece: " - riece-away-indicator - riece-operator-indicator - riece-channel-status-indicator - " " - riece-user-indicator - " " - riece-channel-indicator)) + riece-mode-line-buffer-identification) truncate-lines nil) (riece-simplify-mode-line-format) (use-local-map riece-command-mode-map) @@ -436,21 +439,24 @@ Instead, these commands are available: (make-local-variable 'truncate-partial-width-windows) (setq truncate-partial-width-windows nil) + (make-local-variable 'riece-mode-line-buffer-identification) (setq riece-freeze riece-default-freeze riece-away-indicator "-" riece-operator-indicator "-" riece-channel-status-indicator "-" major-mode 'riece-dialogue-mode mode-name "Dialogue" + riece-mode-line-buffer-identification + '("Riece: " + riece-away-indicator + riece-operator-indicator + riece-freeze-indicator + riece-channel-status-indicator + " " + riece-channel-list-indicator " ") mode-line-buffer-identification (riece-mode-line-buffer-identification - '("Riece: " - riece-away-indicator - riece-operator-indicator - riece-freeze-indicator - riece-channel-status-indicator - " " - riece-channel-list-indicator " ")) + riece-mode-line-buffer-identification) truncate-lines nil buffer-read-only t) (riece-simplify-mode-line-format) @@ -472,15 +478,18 @@ All normal editing commands are turned off. Instead, these commands are available: \\{riece-channel-mode-map}" (make-local-variable 'riece-channel-buffer-window-point) - (setq mode-line-buffer-identification + (make-local-variable 'riece-mode-line-buffer-identification) + (setq riece-mode-line-buffer-identification + '("Riece: " + riece-away-indicator + riece-operator-indicator + riece-freeze-indicator + riece-channel-status-indicator + " " + riece-long-channel-indicator) + mode-line-buffer-identification (riece-mode-line-buffer-identification - '("Riece: " - riece-away-indicator - riece-operator-indicator - riece-freeze-indicator - riece-channel-status-indicator - " " - riece-long-channel-indicator)))) + riece-mode-line-buffer-identification))) (defun riece-channel-list-mode () "Major mode for displaying channel list. @@ -493,10 +502,13 @@ All normal editing commands are turned off." (make-local-variable 'truncate-partial-width-windows) (setq truncate-partial-width-windows nil) + (make-local-variable 'riece-mode-line-buffer-identification) (setq major-mode 'riece-channel-list-mode mode-name "Channels" + riece-mode-line-buffer-identification '("Riece: ") mode-line-buffer-identification - (riece-mode-line-buffer-identification '("Riece: ")) + (riece-mode-line-buffer-identification + riece-mode-line-buffer-identification) truncate-lines t buffer-read-only t) (make-local-hook 'riece-update-buffer-functions) @@ -518,11 +530,14 @@ Instead, these commands are available: (make-local-variable 'truncate-partial-width-windows) (setq truncate-partial-width-windows nil) + (make-local-variable 'riece-mode-line-buffer-identification) (setq major-mode 'riece-user-list-mode mode-name "Users" + riece-mode-line-buffer-identification + '("Riece: " riece-long-channel-indicator " ") mode-line-buffer-identification (riece-mode-line-buffer-identification - '("Riece: " riece-long-channel-indicator " ")) + riece-mode-line-buffer-identification) truncate-lines t buffer-read-only t) (if (boundp 'transient-mark-mode)