Commit a86b330f authored by Juri Linkov's avatar Juri Linkov
Browse files

(kill-this-buffer): Use menu-bar-non-minibuffer-window-p

to check if the current buffer is the minibuffer, and in this case
call abort-recursive-edit to kill the minibuffer.  Doc fix.
(kill-this-buffer-enabled-p): Allow this function to return non-nil
when the current buffer is the minibuffer.
parent 363de02e
......@@ -1439,9 +1439,13 @@ for the definition of the menu frame."
(not (window-minibuffer-p (frame-selected-window menu-frame)))))
(defun kill-this-buffer () ; for the menu bar
"Kill the current buffer."
"Kill the current buffer.
When called in the minibuffer, get out of the minibuffer
using `abort-recursive-edit'."
(interactive)
(kill-buffer (current-buffer)))
(if (menu-bar-non-minibuffer-window-p)
(kill-buffer (current-buffer))
(abort-recursive-edit)))
(defun kill-this-buffer-enabled-p ()
(let ((count 0)
......@@ -1450,8 +1454,8 @@ for the definition of the menu frame."
(or (string-match "^ " (buffer-name (car buffers)))
(setq count (1+ count)))
(setq buffers (cdr buffers)))
(and (menu-bar-non-minibuffer-window-p)
(> count 1))))
(or (not (menu-bar-non-minibuffer-window-p))
(> count 1))))
(put 'dired 'menu-enable '(menu-bar-non-minibuffer-window-p))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment