From: ueno Date: Fri, 26 Aug 2005 08:32:58 +0000 (+0000) Subject: Make riece-button re-installable. X-Git-Tag: channel-coding-branchpoint~52 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=2260a8385d504c8f46e05094f7cc24e6abd91632;p=elisp%2Friece.git Make riece-button re-installable. --- diff --git a/lisp/riece-button.el b/lisp/riece-button.el index cbb16d6..9d85a14 100644 --- a/lisp/riece-button.el +++ b/lisp/riece-button.el @@ -253,6 +253,20 @@ This function is used as a callback for a channel button." 'riece-button-user-list-mode-hook) (add-hook 'riece-dialogue-mode-hook 'riece-button-dialogue-mode-hook) + (save-excursion + (when riece-channel-list-buffer + (set-buffer riece-channel-list-buffer) + (riece-button-channel-list-mode-hook)) + (when riece-user-list-buffer + (set-buffer riece-user-list-buffer) + (riece-button-user-list-mode-hook)) + (let ((buffers riece-buffer-list)) + (while buffers + (set-buffer (car buffers)) + (if (eq (derived-mode-class major-mode) + 'riece-dialogue-mode) + (riece-button-dialogue-mode-hook)) + (setq buffers (cdr buffers))))) (add-hook 'riece-after-insert-functions 'riece-button-add-identity-button)) (defun riece-button-uninstall () @@ -262,6 +276,9 @@ This function is used as a callback for a channel button." (set-buffer (car buffers)) (remove-hook 'riece-update-buffer-functions 'riece-button-update-buffer) + (if (local-variable-p 'riece-identity-button-map + (car buffers)) + (kill-local-variable 'riece-identity-button-map)) (setq buffers (cdr buffers))))) (remove-hook 'riece-channel-list-mode-hook 'riece-button-channel-list-mode-hook)