+2011-07-20 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * 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 <yamaoka@jpl.org>
* wl-e21.el (wl-e21-make-toolbar-buttons): Work around the Emacs
(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)
;; 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)