]> code.delx.au - gnu-emacs/commitdiff
Fix TTY menu invocation via M-x.
authorEli Zaretskii <eliz@gnu.org>
Mon, 2 Jun 2014 18:58:36 +0000 (21:58 +0300)
committerEli Zaretskii <eliz@gnu.org>
Mon, 2 Jun 2014 18:58:36 +0000 (21:58 +0300)
 lisp/menu-bar.el (menu-bar-open): Fix invocation via M-x by forcing
 the update of the menu bar.

lisp/ChangeLog
lisp/menu-bar.el

index 8e3810f907b857189a04776acf484a146028f897..8d4c8d914501dcd9e3938d3437d8c56897ac82e4 100644 (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
index f9cbc62b4647913944c06abf433305ef389fe155..8658a31cb585f17f95e32503f3573dac9c64a71e 100644 (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