diff options
| author | Juri Linkov | 2004-12-14 02:24:33 +0000 |
|---|---|---|
| committer | Juri Linkov | 2004-12-14 02:24:33 +0000 |
| commit | a6a2fd5e30b51c7a03b3407fafa4c2f9d761fa6d (patch) | |
| tree | d5e37225f40cf9a34341dfb9016ea0d16563a0a4 | |
| parent | 37d8fcc253e253b425eb20bc832e9799253b5b78 (diff) | |
| download | emacs-a6a2fd5e30b51c7a03b3407fafa4c2f9d761fa6d.tar.gz emacs-a6a2fd5e30b51c7a03b3407fafa4c2f9d761fa6d.zip | |
(list-buffers-noselect): Collect internal info
for every buffer in BUFFER-LIST arg too.
| -rw-r--r-- | lisp/buff-menu.el | 83 |
1 files changed, 40 insertions, 43 deletions
diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el index 990ab32c9a4..7beaf15fc22 100644 --- a/lisp/buff-menu.el +++ b/lisp/buff-menu.el | |||
| @@ -671,8 +671,7 @@ For more information, see the function `buffer-menu'." | |||
| 671 | ;; line with the beginning of the text (rather than with the left | 671 | ;; line with the beginning of the text (rather than with the left |
| 672 | ;; scrollbar or the left fringe). –-Stef | 672 | ;; scrollbar or the left fringe). –-Stef |
| 673 | (setq header (concat (propertize " " 'display '(space :align-to 0)) | 673 | (setq header (concat (propertize " " 'display '(space :align-to 0)) |
| 674 | header)) | 674 | header))) |
| 675 | ) | ||
| 676 | (with-current-buffer (get-buffer-create "*Buffer List*") | 675 | (with-current-buffer (get-buffer-create "*Buffer List*") |
| 677 | (setq buffer-read-only nil) | 676 | (setq buffer-read-only nil) |
| 678 | (erase-buffer) | 677 | (erase-buffer) |
| @@ -684,47 +683,45 @@ For more information, see the function `buffer-menu'." | |||
| 684 | (mapcar (lambda (c) | 683 | (mapcar (lambda (c) |
| 685 | (if (memq c '(?\n ?\ )) c underline)) | 684 | (if (memq c '(?\n ?\ )) c underline)) |
| 686 | header))))) | 685 | header))))) |
| 687 | (if buffer-list | 686 | ;; Collect info for every buffer we're interested in. |
| 688 | (setq list buffer-list) | 687 | (dolist (buffer (or buffer-list (buffer-list))) |
| 689 | ;; Collect info for every buffer we're interested in. | 688 | (with-current-buffer buffer |
| 690 | (dolist (buffer (buffer-list)) | 689 | (let ((name (buffer-name)) |
| 691 | (with-current-buffer buffer | 690 | (file buffer-file-name)) |
| 692 | (let ((name (buffer-name)) | 691 | (unless (and (not buffer-list) |
| 693 | (file buffer-file-name)) | 692 | (or |
| 694 | (cond | 693 | ;; Don't mention internal buffers. |
| 695 | ;; Don't mention internal buffers. | 694 | (and (string= (substring name 0 1) " ") (null file)) |
| 696 | ((and (string= (substring name 0 1) " ") (null file))) | 695 | ;; Maybe don't mention buffers without files. |
| 697 | ;; Maybe don't mention buffers without files. | 696 | (and files-only (not file)) |
| 698 | ((and files-only (not file))) | 697 | (string= name "*Buffer List*"))) |
| 699 | ((string= name "*Buffer List*")) | 698 | ;; Otherwise output info. |
| 700 | ;; Otherwise output info. | 699 | (let ((mode (concat (format-mode-line mode-name nil nil buffer) |
| 701 | (t | 700 | (if mode-line-process |
| 702 | (let ((mode (concat (format-mode-line mode-name nil nil buffer) | 701 | (format-mode-line mode-line-process |
| 703 | (if mode-line-process | 702 | nil nil buffer)))) |
| 704 | (format-mode-line mode-line-process | 703 | (bits (string |
| 705 | nil nil buffer)))) | 704 | (if (eq buffer old-buffer) ?. ?\ ) |
| 706 | (bits (string | 705 | ;; Handle readonly status. The output buffer |
| 707 | (if (eq buffer old-buffer) ?. ?\ ) | 706 | ;; is special cased to appear readonly; it is |
| 708 | ;; Handle readonly status. The output buffer | 707 | ;; actually made so at a later date. |
| 709 | ;; is special cased to appear readonly; it is | 708 | (if (or (eq buffer standard-output) |
| 710 | ;; actually made so at a later date. | 709 | buffer-read-only) |
| 711 | (if (or (eq buffer standard-output) | 710 | ?% ?\ ) |
| 712 | buffer-read-only) | 711 | ;; Identify modified buffers. |
| 713 | ?% ?\ ) | 712 | (if (buffer-modified-p) ?* ?\ ) |
| 714 | ;; Identify modified buffers. | 713 | ;; Space separator. |
| 715 | (if (buffer-modified-p) ?* ?\ ) | 714 | ?\ ))) |
| 716 | ;; Space separator. | 715 | (unless file |
| 717 | ?\ ))) | 716 | ;; No visited file. Check local value of |
| 718 | (unless file | 717 | ;; list-buffers-directory. |
| 719 | ;; No visited file. Check local value of | 718 | (when (and (boundp 'list-buffers-directory) |
| 720 | ;; list-buffers-directory. | 719 | list-buffers-directory) |
| 721 | (when (and (boundp 'list-buffers-directory) | 720 | (setq file list-buffers-directory))) |
| 722 | list-buffers-directory) | 721 | (push (list buffer bits name (buffer-size) mode file) |
| 723 | (setq file list-buffers-directory))) | 722 | list)))))) |
| 724 | (push (list buffer bits name (buffer-size) mode file) | 723 | ;; Preserve the original buffer-list ordering, just in case. |
| 725 | list))))))) | 724 | (setq list (nreverse list)) |
| 726 | ;; Preserve the original buffer-list ordering, just in case. | ||
| 727 | (setq list (nreverse list))) | ||
| 728 | ;; Place the buffers's info in the output buffer, sorted if necessary. | 725 | ;; Place the buffers's info in the output buffer, sorted if necessary. |
| 729 | (dolist (buffer | 726 | (dolist (buffer |
| 730 | (if Buffer-menu-sort-column | 727 | (if Buffer-menu-sort-column |