]> git.eshelyaron.com Git - emacs.git/commitdiff
Have kill-this-buffer don't do anything when frame is not alive or visible (Bug#8184).
authorMartin Rudalics <rudalics@gmx.at>
Wed, 3 Oct 2012 08:50:49 +0000 (10:50 +0200)
committerMartin Rudalics <rudalics@gmx.at>
Wed, 3 Oct 2012 08:50:49 +0000 (10:50 +0200)
* menu-bar.el (kill-this-buffer): Don't do anything when
`menu-frame' is not alive or visible (Bug#8184).

lisp/ChangeLog
lisp/menu-bar.el

index 34afcee4b1c9a18bcacf1b97612e2b0327185f9e..1b115e5c5d5b62c483dfc91775a6c5c8c1b94676 100644 (file)
@@ -1,5 +1,8 @@
 2012-10-03  Martin Rudalics  <rudalics@gmx.at>
 
+       * menu-bar.el (kill-this-buffer): Don't do anything when
+       `menu-frame' is not alive or visible (Bug#8184).
+
        * emacs-lisp/debug.el (debug): When quitting the debugger window
        restore current buffer (Bug#12502).
 
index 010b4edfb058d995532d231b2f3cc274f381023a..88e59eff86bc5c06f5fd3d1f3c222e3dae1414a1 100644 (file)
@@ -1812,9 +1812,14 @@ for the definition of the menu frame."
 When called in the minibuffer, get out of the minibuffer
 using `abort-recursive-edit'."
   (interactive)
-  (if (menu-bar-non-minibuffer-window-p)
-      (kill-buffer (current-buffer))
-    (abort-recursive-edit)))
+  (cond
+   ;; Don't do anything when `menu-frame' is not alive or visible
+   ;; (Bug#8184).
+   ((not (menu-bar-menu-frame-live-and-visible-p)))
+   ((menu-bar-non-minibuffer-window-p)
+    (kill-buffer (current-buffer)))
+   (t
+    (abort-recursive-edit))))
 
 (defun kill-this-buffer-enabled-p ()
   "Return non-nil if the `kill-this-buffer' menu item should be enabled."