summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2013-10-06 20:38:20 +0300
committerEli Zaretskii <eliz@gnu.org>2013-10-06 20:38:20 +0300
commitca3433569a131207a37e05f9603fc5082b94359d (patch)
tree912cfdd6505a9a0955884cacc6dbf1d91e5a6e6c
parentf9e5cb0ad3a19e7c630d469720ec3576e5c17514 (diff)
downloademacs-ca3433569a131207a37e05f9603fc5082b94359d.tar.gz
F10 invokes menu by X,Y.
-rw-r--r--lisp/menu-bar.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 52cf0fd2f6d..892ef49cb54 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -2182,13 +2182,14 @@ See `menu-bar-mode' for more information."
(declare-function x-menu-bar-open "term/x-win" (&optional frame))
(declare-function w32-menu-bar-open "term/w32-win" (&optional frame))
-(defun popup-menu (menu &optional position prefix)
+(defun popup-menu (menu &optional position prefix from-menu-bar)
"Popup the given menu and call the selected option.
MENU can be a keymap, an easymenu-style menu or a list of keymaps as for
`x-popup-menu'.
The menu is shown at the place where POSITION specifies. About
the form of POSITION, see `popup-menu-normalize-position'.
-PREFIX is the prefix argument (if any) to pass to the command."
+PREFIX is the prefix argument (if any) to pass to the command.
+FROM-MENU-BAR, if non-nil, means we are dropping one of menu-bar's menus."
(let* ((map (cond
((keymapp menu) menu)
((and (listp menu) (keymapp (car menu))) menu)
@@ -2361,7 +2362,9 @@ If FRAME is nil or not given, use the selected frame."
((null tty-menu-open-use-tmm)
;; FIXME: This should open the leftmost menu, and let the user
;; move to others via C-f or right-arrow.
- (popup-menu menu-bar-tools-menu (posn-at-x-y 30 0 nil t)))
+ (let ((menu (menu-bar-menu-at-x-y 10 0 frame)))
+ (popup-menu (lookup-key global-map (vector 'menu-bar menu))
+ (posn-at-x-y 10 0 nil t) t)))
(t (with-selected-frame (or frame (selected-frame))
(tmm-menubar))))))