X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Friece-button.el;h=b7f51261eeedfb4d5686b098086eae7b9f88f62d;hb=d46659ca66fb4c47cafc244aa3a3dbf76ad10fa8;hp=9d85a1451767d07f54e2f626fb36c0015f524d40;hpb=2260a8385d504c8f46e05094f7cc24e6abd91632;p=elisp%2Friece.git diff --git a/lisp/riece-button.el b/lisp/riece-button.el index 9d85a14..b7f5126 100644 --- a/lisp/riece-button.el +++ b/lisp/riece-button.el @@ -19,8 +19,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -48,8 +48,6 @@ ["Set +v" riece-user-button-set-speakers]) "Menu for user buttons.") -(defvar riece-button-enabled nil) - (defconst riece-button-description "Display useful buttons in IRC buffers.") @@ -206,7 +204,7 @@ This function is used as a callback for a channel button." (defvar riece-identity-button-map) (defun riece-button-add-identity-button (start end) - (if riece-button-enabled + (if (get 'riece-button 'riece-addon-enabled) (riece-scan-property-region 'riece-identity start end @@ -247,12 +245,6 @@ This function is used as a callback for a channel button." (riece-make-identity-button-map))) (defun riece-button-insinuate () - (add-hook 'riece-channel-list-mode-hook - 'riece-button-channel-list-mode-hook) - (add-hook 'riece-user-list-mode-hook - '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) @@ -267,6 +259,12 @@ This function is used as a callback for a channel button." 'riece-dialogue-mode) (riece-button-dialogue-mode-hook)) (setq buffers (cdr buffers))))) + (add-hook 'riece-channel-list-mode-hook + 'riece-button-channel-list-mode-hook) + (add-hook 'riece-user-list-mode-hook + 'riece-button-user-list-mode-hook) + (add-hook 'riece-dialogue-mode-hook + 'riece-button-dialogue-mode-hook) (add-hook 'riece-after-insert-functions 'riece-button-add-identity-button)) (defun riece-button-uninstall () @@ -275,7 +273,7 @@ This function is used as a callback for a channel button." (while buffers (set-buffer (car buffers)) (remove-hook 'riece-update-buffer-functions - 'riece-button-update-buffer) + 'riece-button-update-buffer t) (if (local-variable-p 'riece-identity-button-map (car buffers)) (kill-local-variable 'riece-identity-button-map)) @@ -290,7 +288,6 @@ This function is used as a callback for a channel button." 'riece-button-add-identity-button)) (defun riece-button-enable () - (setq riece-button-enabled t) (let ((pointer riece-buffer-list)) (while pointer (with-current-buffer (car pointer) @@ -303,7 +300,6 @@ This function is used as a callback for a channel button." (riece-emit-signal 'channel-list-changed))) (defun riece-button-disable () - (setq riece-button-enabled nil) (save-excursion (let ((pointer riece-buffer-list)) (while pointer