From 335908691102a2aad107ce00046ee98e80509ff1 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 2 Jun 2014 21:58:36 +0300 Subject: [PATCH] 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. --- lisp/ChangeLog | 4 ++++ lisp/menu-bar.el | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8e3810f907b..8d4c8d91450 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2014-06-02 Eli Zaretskii + + * menu-bar.el (menu-bar-open): Fix invocation via M-x. + 2014-06-01 Eli Zaretskii * simple.el (keyboard-quit): Force update of mode lines, to remove diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index f9cbc62b464..8658a31cb58 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -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 -- 2.39.2