Commit 0f790c74 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(kill-buffer-and-window): Remove `yes-or-no-p' so that

the function is less noisy.  Now only `kill-buffer' can ask questions.
parent f87ef6b1
......@@ -532,11 +532,18 @@ Return non-nil if the window was shrunk."
(defun kill-buffer-and-window ()
"Kill the current buffer and delete the selected window."
(if (yes-or-no-p (format "Kill buffer `%s'? " (buffer-name)))
(let ((buffer (current-buffer)))
(delete-window (selected-window))
(kill-buffer buffer))
(error "Aborted")))
(let ((window-to-delete (selected-window))
(delete-window-hook (lambda ()
(condition-case nil
(error nil)))))
(add-hook 'kill-buffer-hook delete-window-hook t t)
(if (kill-buffer (current-buffer))
;; If `delete-window' failed before, we rerun it to regenerate
;; the error so it can be seen in the minibuffer.
(when (eq (selected-window) window-to-delete)
(remove-hook 'kill-buffer-hook delete-window-hook t))))
(defun quit-window (&optional kill window)
"Quit the current buffer. Bury it, and maybe delete the selected frame.
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