]> code.delx.au - gnu-emacs/commitdiff
Handle dead frame in menu-bar-non-minibuffer-window-p. (Bug#19728)
authorMartin Rudalics <rudalics@gmx.at>
Sat, 31 Jan 2015 18:38:58 +0000 (19:38 +0100)
committerMartin Rudalics <rudalics@gmx.at>
Sat, 31 Jan 2015 18:38:58 +0000 (19:38 +0100)
* menu-bar.el (menu-bar-non-minibuffer-window-p): Return nil when
the menu frame is dead.  (Bug#19728)

lisp/ChangeLog
lisp/menu-bar.el

index 51d47a791ad9157ec8438b593da66aefbcb0fdc3..6cdaf14abe20deadaeffcb6315b4f109bdb9d4b7 100644 (file)
@@ -1,3 +1,8 @@
+2015-01-31  Martin Rudalics  <rudalics@gmx.at>
+
+       * menu-bar.el (menu-bar-non-minibuffer-window-p): Return nil when
+       the menu frame is dead.  (Bug#19728)
+
 2015-01-30  Fabián Ezequiel Gallina  <fgallina@gnu.org>
 
        python.el: Handle tabs in python-indent-dedent-line.
index 25d41dcdd858292b30326003fa49bd7f8f01dab7..e82c089850afc474ffc06bab162b64a4ba7be858 100644 (file)
@@ -1737,12 +1737,14 @@ The menu frame is the frame for which we are updating the menu."
         (frame-visible-p menu-frame))))
 
 (defun menu-bar-non-minibuffer-window-p ()
-  "Return non-nil if selected window of the menu frame is not a minibuf window.
-
-See the documentation of `menu-bar-menu-frame-live-and-visible-p'
-for the definition of the menu frame."
+  "Return non-nil if the menu frame's selected window is no minibuffer window.
+Return nil if the menu frame is dead or its selected window is a
+minibuffer window.  The menu frame is the frame for which we are
+updating the menu."
   (let ((menu-frame (or menu-updating-frame (selected-frame))))
-    (not (window-minibuffer-p (frame-selected-window menu-frame)))))
+    (and (frame-live-p menu-frame)
+        (not (window-minibuffer-p
+              (frame-selected-window menu-frame))))))
 
 (defun kill-this-buffer ()     ; for the menu bar
   "Kill the current buffer.