emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 70d01da: kill-matching-buffers to optionally not co


From: Glenn Morris
Subject: [Emacs-diffs] master 70d01da: kill-matching-buffers to optionally not confirm
Date: Mon, 19 Jun 2017 21:32:16 -0400 (EDT)

branch: master
commit 70d01daceddeb4e4c49c79473c81420f65ffd290
Author: Glenn Morris <address@hidden>
Commit: Glenn Morris <address@hidden>

    kill-matching-buffers to optionally not confirm
    
    * lisp/files.el (kill-matching-buffers):
    Add option to not confirm killing.  (Bug#27286)
---
 lisp/files.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lisp/files.el b/lisp/files.el
index 2930f30..06f49bb 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -6077,16 +6077,18 @@ specifies the list of buffers to kill, asking for 
approval for each one."
           (kill-buffer-ask buffer)))
     (setq list (cdr list))))
 
-(defun kill-matching-buffers (regexp &optional internal-too)
+(defun kill-matching-buffers (regexp &optional internal-too no-ask)
   "Kill buffers whose name matches the specified REGEXP.
-The optional second argument indicates whether to kill internal buffers too."
+Ignores buffers whose name starts with a space, unless optional
+prefix argument INTERNAL-TOO is non-nil.  Asks before killing
+each buffer, unless NO-ASK is non-nil."
   (interactive "sKill buffers matching this regular expression: \nP")
   (dolist (buffer (buffer-list))
     (let ((name (buffer-name buffer)))
       (when (and name (not (string-equal name ""))
                  (or internal-too (/= (aref name 0) ?\s))
                  (string-match regexp name))
-        (kill-buffer-ask buffer)))))
+        (funcall (if no-ask 'kill-buffer 'kill-buffer-ask) buffer)))))
 
 
 (defun rename-auto-save-file ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]