diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 1a81f1a3d0..94e75efeeb 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -2738,7 +2738,7 @@ menu-bar-keymap ;; sorting. (push (cons pos menu-item) menu-end) (push menu-item menu-bar)))) - (lookup-key (or keymap (menu-bar-current-active-maps)) [menu-bar])) + (or keymap (lookup-key (menu-bar-current-active-maps) [menu-bar]))) `(keymap ,@(nreverse menu-bar) ,@(mapcar #'cdr (sort menu-end (lambda (a b) diff --git a/lisp/mouse.el b/lisp/mouse.el index d6912892ef..5b9ae121d7 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -271,10 +271,10 @@ mouse-menu-bar-map ;; FIXME: We have a problem here: we have to use the global/local/minor ;; so they're displayed in the expected order, but later on in the command ;; loop, they're actually looked up in the opposite order. - (apply 'append - global-menu - local-menu - minor-mode-menus))) + (menu-bar-keymap (apply 'append + global-menu + local-menu + minor-mode-menus)))) ;; Context menus. @@ -364,7 +364,7 @@ context-menu-global (when (consp binding) (define-key-after menu (vector key) (copy-sequence binding)))) - (menu-bar-keymap global-map)) + (menu-bar-keymap (lookup-key global-map [menu-bar]))) menu) (defun context-menu-local (menu _click) @@ -377,7 +377,7 @@ context-menu-local (when (consp binding) (define-key-after menu (vector key) (copy-sequence binding)))) - keymap))) + (menu-bar-keymap keymap)))) menu) (defun context-menu-minor (menu _click)