Have kill-this-buffer don't do anything when frame is not alive or visible (Bug#8184).

* menu-bar.el (kill-this-buffer): Don't do anything when
`menu-frame' is not alive or visible (Bug#8184).
This commit is contained in:
Martin Rudalics 2012-10-03 10:50:49 +02:00
parent 2e566ecb82
commit 96ef9ccd1b
2 changed files with 11 additions and 3 deletions

View 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).

View 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."