From: yamaoka Date: Wed, 20 Jul 2011 01:16:55 +0000 (+0000) Subject: wl-e21.el (wl-e21-make-toolbar-buttons): No need to take care of X-Git-Tag: merged-trunk-to-elmo-imap4-compliance-3^2 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=59c8c8a72f23d13a1537d8761039798a8e336ddb;p=elisp%2Fwanderlust.git wl-e21.el (wl-e21-make-toolbar-buttons): No need to take care of the tool-bar default bindings for Emacs 24. --- diff --git a/wl/ChangeLog b/wl/ChangeLog index a91307d..0d00c4e 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,8 @@ +2011-07-20 Katsumi Yamaoka + + * wl-e21.el (wl-e21-make-toolbar-buttons): No need to take care of + the tool-bar default bindings for Emacs 24. + 2011-07-19 Katsumi Yamaoka * wl-e21.el (wl-e21-make-toolbar-buttons): Work around the Emacs diff --git a/wl/wl-e21.el b/wl/wl-e21.el index f5db2f6..c2487c5 100644 --- a/wl/wl-e21.el +++ b/wl/wl-e21.el @@ -215,7 +215,6 @@ (tool-bar-button-margin . 2) (tool-bar-button-relief . 1))) -;; FIXME: this function should be rewritten in a proper way. (defun wl-e21-make-toolbar-buttons (keymap defs) (let ((configs wl-e21-toolbar-configurations) config) @@ -224,20 +223,19 @@ ;; Invalidate the default bindings. (let ((keys (cdr (key-binding [tool-bar] t))) item) - (while (setq item (pop keys)) - (when (setq item (car-safe item)) - (ignore-errors ;; workaround + (unless (eq (caar keys) 'keymap) ;; Emacs >= 24 + (while (setq item (pop keys)) + (when (setq item (car-safe item)) (define-key keymap (vector 'tool-bar item) 'undefined))))) (let ((n (length defs)) def) (while (>= n 0) (setq n (1- n) def (nth n defs)) - (ignore-errors ;; workaround - (define-key keymap (vector 'tool-bar (aref def 1)) - (list 'menu-item (aref def 3) (aref def 1) - :enable (aref def 2) - :image (symbol-value (aref def 0)))))))) + (define-key keymap (vector 'tool-bar (aref def 1)) + (list 'menu-item (aref def 3) (aref def 1) + :enable (aref def 2) + :image (symbol-value (aref def 0))))))) (defun wl-e21-setup-folder-toolbar () (when (wl-e21-setup-toolbar wl-folder-toolbar)