diff options
Diffstat (limited to 'lisp/tool-bar.el')
| -rw-r--r-- | lisp/tool-bar.el | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/lisp/tool-bar.el b/lisp/tool-bar.el index 18a75437f97..c1fcd530d60 100644 --- a/lisp/tool-bar.el +++ b/lisp/tool-bar.el @@ -232,6 +232,7 @@ holds a keymap." submap key) ;; We'll pick up the last valid entry in the list of keys if ;; there's more than one. + ;; FIXME: Aren't they *all* "valid"?? --Stef (dolist (k keys) ;; We're looking for a binding of the command in a submap of ;; the menu bar map, so the key sequence must be two or more @@ -242,24 +243,24 @@ holds a keymap." ;; Last element in the bound key sequence: (kk (aref k (1- (length k))))) (if (and (keymapp m) - (symbolp kk)) + (symbolp kk)) ;FIXME: Why? --Stef (setq submap m key kk))))) - (when (and (symbolp submap) (boundp submap)) - (setq submap (eval submap))) - (let ((defn (assq key (cdr submap)))) - (if (eq (cadr defn) 'menu-item) - (define-key-after in-map (vector key) - (append (cdr defn) (list :image image-exp) props)) - (setq defn (cdr defn)) + (when submap + (let ((defn nil)) + ;; Here, we're essentially doing a "lookup-key without get_keyelt". + (map-keymap (lambda (k b) (if (eq k key) (setq defn b))) + submap) (define-key-after in-map (vector key) - (let ((rest (cdr defn))) - ;; If the rest of the definition starts - ;; with a list of menu cache info, get rid of that. - (if (and (consp rest) (consp (car rest))) - (setq rest (cdr rest))) - (append `(menu-item ,(car defn) ,rest) - (list :image image-exp) props))))))) + (if (eq (car defn) 'menu-item) + (append (cdr defn) (list :image image-exp) props) + (let ((rest (cdr defn))) + ;; If the rest of the definition starts + ;; with a list of menu cache info, get rid of that. + (if (and (consp rest) (consp (car rest))) + (setq rest (cdr rest))) + (append `(menu-item ,(car defn) ,rest) + (list :image image-exp) props)))))))) ;;; Set up some global items. Additions/deletions up for grabs. |
