]> code.delx.au - gnu-emacs/blobdiff - lisp/menu-bar.el
Merge from origin/emacs-24
[gnu-emacs] / lisp / menu-bar.el
index 7d7e4660fb55bac0332ff3c857d045c3e4f42a1a..5fdb9377a48900b9741476cdb2b70ad1be54c53f 100644 (file)
 
     (bindings--define-key menu [xref-pop]
       '(menu-item "Back" xref-pop-marker-stack
+                  :visible (and (featurep 'xref)
+                                (not (xref-marker-stack-empty-p)))
                   :help "Back to the position of the last search"))
 
     (bindings--define-key menu [xref-apropos]
@@ -1745,12 +1747,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.