diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2022-04-26 14:32:07 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2022-04-26 14:32:07 +0200 |
commit | a38b7d3e90af0b4421965ece5ccd888b095e0186 (patch) | |
tree | f49ad17e7ee0d439652ba088f5b7044fd06e6f4d /lisp | |
parent | 631a8ae9ee9c79b420cadb188d65503a3eea9b16 (diff) | |
download | emacs-a38b7d3e90af0b4421965ece5ccd888b095e0186.tar.gz emacs-a38b7d3e90af0b4421965ece5ccd888b095e0186.tar.bz2 emacs-a38b7d3e90af0b4421965ece5ccd888b095e0186.zip |
Tweak interactive use of delete-windows-on
* lisp/window.el (delete-windows-on): Make prompting better, and
allow specifying only the current frame interactively (bug#34749).
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/window.el | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/lisp/window.el b/lisp/window.el index c15f14cc61d..dc33eb8a12a 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -5007,7 +5007,11 @@ minibuffer window or is dedicated to its buffer." BUFFER-OR-NAME may be a buffer or the name of an existing buffer and defaults to the current buffer. -Interactively, prompt for the buffer. +Interactively, this command will prompt for the buffer name. A +prefix argument of 0 (zero) means that only windows in the +current terminal's frames will be deleted. Any other prefix +argument means that only windows in the current frame will be +deleted. The following non-nil values of the optional argument FRAME have special meanings: @@ -5044,7 +5048,21 @@ If the buffer specified by BUFFER-OR-NAME is shown in a minibuffer window, do nothing for that window. For any window that does not show that buffer, remove the buffer from that window's lists of previous and next buffers." - (interactive "bDelete windows on (buffer):\nP") + (interactive + (let ((frame (cond + ((and (numberp current-prefix-arg) + (zerop current-prefix-arg)) + 0) + (current-prefix-arg t)))) + (list (read-buffer "Delete windows on (buffer): " + nil nil + (lambda (buf) + (get-buffer-window + (if (consp buf) (car buf) buf) + (cond + ((null frame) t) + ((numberp frame) frame))))) + frame))) (let ((buffer (window-normalize-buffer buffer-or-name)) ;; Handle the "inverted" meaning of the FRAME argument wrt other ;; `window-list-1' based function. |