aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2013-10-08 11:22:56 +0300
committerEli Zaretskii2013-10-08 11:22:56 +0300
commit1f16a64c411543673ff5ce3e7f52df549ec356e3 (patch)
tree54fa6abe71f2fa0563b466f783f4ec516faa5129
parentca3433569a131207a37e05f9603fc5082b94359d (diff)
downloademacs-1f16a64c411543673ff5ce3e7f52df549ec356e3.tar.gz
emacs-1f16a64c411543673ff5ce3e7f52df549ec356e3.zip
F10 can now invoke menu-bar menus from local map.
-rw-r--r--lisp/menu-bar.el14
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 892ef49cb54..41a02019039 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -2344,6 +2344,11 @@ If nil, the current mouse position is used."
2344(defvar tty-menu-open-use-tmm nil 2344(defvar tty-menu-open-use-tmm nil
2345 "If non-nil, menu-bar-open on a TTY will invoke `tmm-menubar'.") 2345 "If non-nil, menu-bar-open on a TTY will invoke `tmm-menubar'.")
2346 2346
2347(defvar tty-menu--initial-menu-x 10
2348 "X coordinate of the first menu-bar menu dropped by F10.
2349
2350This is meant to be used only for debugging TTY menus.")
2351
2347(defun menu-bar-open (&optional frame) 2352(defun menu-bar-open (&optional frame)
2348 "Start key navigation of the menu bar in FRAME. 2353 "Start key navigation of the menu bar in FRAME.
2349 2354
@@ -2362,9 +2367,12 @@ If FRAME is nil or not given, use the selected frame."
2362 ((null tty-menu-open-use-tmm) 2367 ((null tty-menu-open-use-tmm)
2363 ;; FIXME: This should open the leftmost menu, and let the user 2368 ;; FIXME: This should open the leftmost menu, and let the user
2364 ;; move to others via C-f or right-arrow. 2369 ;; move to others via C-f or right-arrow.
2365 (let ((menu (menu-bar-menu-at-x-y 10 0 frame))) 2370 (let* ((x tty-menu--initial-menu-x)
2366 (popup-menu (lookup-key global-map (vector 'menu-bar menu)) 2371 (menu (menu-bar-menu-at-x-y x 0 frame)))
2367 (posn-at-x-y 10 0 nil t) t))) 2372 (popup-menu (or
2373 (lookup-key global-map (vector 'menu-bar menu))
2374 (lookup-key (current-local-map) (vector 'menu-bar menu)))
2375 (posn-at-x-y x 0 nil t) t)))
2368 (t (with-selected-frame (or frame (selected-frame)) 2376 (t (with-selected-frame (or frame (selected-frame))
2369 (tmm-menubar)))))) 2377 (tmm-menubar))))))
2370 2378