Fix TTY menu invocation via M-x.

lisp/menu-bar.el (menu-bar-open): Fix invocation via M-x by forcing
 the update of the menu bar.
This commit is contained in:
Eli Zaretskii 2014-06-02 21:58:36 +03:00
parent c4e6b585bb
commit 3359086911
2 changed files with 10 additions and 0 deletions

View file

@ -1,3 +1,7 @@
2014-06-02 Eli Zaretskii <eliz@gnu.org>
* menu-bar.el (menu-bar-open): Fix invocation via M-x.
2014-06-01 Eli Zaretskii <eliz@gnu.org>
* simple.el (keyboard-quit): Force update of mode lines, to remove

View file

@ -2267,6 +2267,12 @@ If FRAME is nil or not given, use the selected frame."
((eq type 'w32) (w32-menu-bar-open frame))
((and (null tty-menu-open-use-tmm)
(not (zerop (or (frame-parameter nil 'menu-bar-lines) 0))))
;; Make sure the menu bar is up to date. One situation where
;; this is important is when this function is invoked by name
;; via M-x, in which case the menu bar includes the "Minibuf"
;; menu item that should be removed when we exit the minibuffer.
(force-mode-line-update)
(sit-for 0)
(let* ((x tty-menu--initial-menu-x)
(menu (menu-bar-menu-at-x-y x 0 frame)))
(popup-menu (or