diff options
| author | Richard M. Stallman | 1996-08-29 01:27:18 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-08-29 01:27:18 +0000 |
| commit | 73ba610ac45d310291da6d96894d565a24196322 (patch) | |
| tree | cd9720eee7d6619fb2be603bf2c66adaf02cb3b7 /lisp | |
| parent | 5b6575b75deb35f9891fe45877fc39245aaaecc8 (diff) | |
| download | emacs-73ba610ac45d310291da6d96894d565a24196322.tar.gz emacs-73ba610ac45d310291da6d96894d565a24196322.zip | |
(kill-some-buffers): New arg LIST says buffers to maybe kill.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/files.el | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/lisp/files.el b/lisp/files.el index 154ec33098c..84dd9391846 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -2378,22 +2378,24 @@ This command is used in the special Dired buffer created by | |||
| 2378 | (message "No files can be recovered from this session now"))) | 2378 | (message "No files can be recovered from this session now"))) |
| 2379 | (kill-buffer buffer)))) | 2379 | (kill-buffer buffer)))) |
| 2380 | 2380 | ||
| 2381 | (defun kill-some-buffers () | 2381 | (defun kill-some-buffers (&optional list) |
| 2382 | "For each buffer, ask whether to kill it." | 2382 | "For each buffer in LIST, ask whether to kill it. |
| 2383 | LIST defaults to all existing live buffers." | ||
| 2383 | (interactive) | 2384 | (interactive) |
| 2384 | (let ((list (buffer-list))) | 2385 | (if (null list) |
| 2385 | (while list | 2386 | (setq list (buffer-list))) |
| 2386 | (let* ((buffer (car list)) | 2387 | (while list |
| 2387 | (name (buffer-name buffer))) | 2388 | (let* ((buffer (car list)) |
| 2388 | (and (not (string-equal name "")) | 2389 | (name (buffer-name buffer))) |
| 2389 | (/= (aref name 0) ? ) | 2390 | (and (not (string-equal name "")) |
| 2390 | (yes-or-no-p | 2391 | (/= (aref name 0) ? ) |
| 2391 | (format "Buffer %s %s. Kill? " | 2392 | (yes-or-no-p |
| 2392 | name | 2393 | (format "Buffer %s %s. Kill? " |
| 2393 | (if (buffer-modified-p buffer) | 2394 | name |
| 2394 | "HAS BEEN EDITED" "is unmodified"))) | 2395 | (if (buffer-modified-p buffer) |
| 2395 | (kill-buffer buffer))) | 2396 | "HAS BEEN EDITED" "is unmodified"))) |
| 2396 | (setq list (cdr list))))) | 2397 | (kill-buffer buffer))) |
| 2398 | (setq list (cdr list)))) | ||
| 2397 | 2399 | ||
| 2398 | (defun auto-save-mode (arg) | 2400 | (defun auto-save-mode (arg) |
| 2399 | "Toggle auto-saving of contents of current buffer. | 2401 | "Toggle auto-saving of contents of current buffer. |