Mercurial > emacs
changeset 15963:5b10dc4cd791
(kill-some-buffers): New arg LIST says buffers to maybe kill.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 29 Aug 1996 01:27:18 +0000 |
parents | 37baba8d7fbc |
children | 0e6def53a74f |
files | lisp/files.el |
diffstat | 1 files changed, 17 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/files.el Thu Aug 29 01:25:34 1996 +0000 +++ b/lisp/files.el Thu Aug 29 01:27:18 1996 +0000 @@ -2378,22 +2378,24 @@ (message "No files can be recovered from this session now"))) (kill-buffer buffer)))) -(defun kill-some-buffers () - "For each buffer, ask whether to kill it." +(defun kill-some-buffers (&optional list) + "For each buffer in LIST, ask whether to kill it. +LIST defaults to all existing live buffers." (interactive) - (let ((list (buffer-list))) - (while list - (let* ((buffer (car list)) - (name (buffer-name buffer))) - (and (not (string-equal name "")) - (/= (aref name 0) ? ) - (yes-or-no-p - (format "Buffer %s %s. Kill? " - name - (if (buffer-modified-p buffer) - "HAS BEEN EDITED" "is unmodified"))) - (kill-buffer buffer))) - (setq list (cdr list))))) + (if (null list) + (setq list (buffer-list))) + (while list + (let* ((buffer (car list)) + (name (buffer-name buffer))) + (and (not (string-equal name "")) + (/= (aref name 0) ? ) + (yes-or-no-p + (format "Buffer %s %s. Kill? " + name + (if (buffer-modified-p buffer) + "HAS BEEN EDITED" "is unmodified"))) + (kill-buffer buffer))) + (setq list (cdr list)))) (defun auto-save-mode (arg) "Toggle auto-saving of contents of current buffer.