diff options
| author | Stefan Monnier | 2004-11-17 17:12:57 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2004-11-17 17:12:57 +0000 |
| commit | f4872033df7b50cb99dba68f73479b844075d263 (patch) | |
| tree | 444447cb4155013969e26518d90bc42ae9cae71a | |
| parent | 2da3fbb1acdba2b4982387c7819feb9e374d1775 (diff) | |
| download | emacs-f4872033df7b50cb99dba68f73479b844075d263.tar.gz emacs-f4872033df7b50cb99dba68f73479b844075d263.zip | |
(list-buffers-noselect): Massage to fit in 80 columns.
Replace mapcar->dolist, format->string.
| -rw-r--r-- | lisp/buff-menu.el | 88 |
1 files changed, 46 insertions, 42 deletions
diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el index 6512e09213a..910d6d6753f 100644 --- a/lisp/buff-menu.el +++ b/lisp/buff-menu.el | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | ;;; buff-menu.el --- buffer menu main function and support functions | 1 | ;;; buff-menu.el --- buffer menu main function and support functions |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 86, 87, 93, 94, 95, 2000, 2001, 2002, 03, 2004 | 3 | ;; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 2000, 2001, 2002, 2003, |
| 4 | ;; Free Software Foundation, Inc. | 4 | ;; 2004 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Maintainer: FSF | 6 | ;; Maintainer: FSF |
| 7 | ;; Keywords: convenience | 7 | ;; Keywords: convenience |
| @@ -652,7 +652,7 @@ For more information, see the function `buffer-menu'." | |||
| 652 | " " | 652 | " " |
| 653 | (Buffer-menu-make-sort-button "Mode" 4) mode-end | 653 | (Buffer-menu-make-sort-button "Mode" 4) mode-end |
| 654 | (Buffer-menu-make-sort-button "File" 5) "\n")) | 654 | (Buffer-menu-make-sort-button "File" 5) "\n")) |
| 655 | list desired-point name mode file) | 655 | list desired-point) |
| 656 | (when Buffer-menu-use-header-line | 656 | (when Buffer-menu-use-header-line |
| 657 | (let ((pos 0)) | 657 | (let ((pos 0)) |
| 658 | ;; Turn spaces in the header into stretch specs so they work | 658 | ;; Turn spaces in the header into stretch specs so they work |
| @@ -672,44 +672,48 @@ For more information, see the function `buffer-menu'." | |||
| 672 | (insert (Buffer-menu-buffer+size "------" "----")) | 672 | (insert (Buffer-menu-buffer+size "------" "----")) |
| 673 | (insert " ----" mode-end "----\n") | 673 | (insert " ----" mode-end "----\n") |
| 674 | (put-text-property 1 (point) 'intangible t)) | 674 | (put-text-property 1 (point) 'intangible t)) |
| 675 | (setq list | 675 | (if buffer-list |
| 676 | (or buffer-list | 676 | (setq list buffer-list) |
| 677 | (delq t | 677 | ;; Collect info for every buffer we're interested in. |
| 678 | (mapcar | 678 | (dolist (buffer (buffer-list)) |
| 679 | (lambda (buffer) | 679 | (with-current-buffer buffer |
| 680 | (with-current-buffer buffer | 680 | (let ((name (buffer-name)) |
| 681 | (setq name (buffer-name) | 681 | (file buffer-file-name)) |
| 682 | mode (concat (format-mode-line mode-name nil nil buffer) | 682 | (cond |
| 683 | (if mode-line-process | 683 | ;; Don't mention internal buffers. |
| 684 | (format-mode-line mode-line-process nil nil buffer))) | 684 | ((and (string= (substring name 0 1) " ") (null file))) |
| 685 | file (buffer-file-name)) | 685 | ;; Maybe don't mention buffers without files. |
| 686 | (cond | 686 | ((and files-only (not file))) |
| 687 | ;; Don't mention internal buffers. | 687 | ((string= name "*Buffer List*")) |
| 688 | ((and (string= (substring name 0 1) " ") (null file))) | 688 | ;; Otherwise output info. |
| 689 | ;; Maybe don't mention buffers without files. | 689 | (t |
| 690 | ((and files-only (not file))) | 690 | (let ((mode (concat (format-mode-line mode-name nil nil buffer) |
| 691 | ((string= name "*Buffer List*")) | 691 | (if mode-line-process |
| 692 | ;; Otherwise output info. | 692 | (format-mode-line mode-line-process |
| 693 | (t | 693 | nil nil buffer)))) |
| 694 | (unless file | 694 | (bits (string |
| 695 | ;; No visited file. Check local value of | 695 | (if (eq buffer old-buffer) ?. ?\ ) |
| 696 | ;; list-buffers-directory. | 696 | ;; Handle readonly status. The output buffer |
| 697 | (when (and (boundp 'list-buffers-directory) | 697 | ;; is special cased to appear readonly; it is |
| 698 | list-buffers-directory) | 698 | ;; actually made so at a later date. |
| 699 | (setq file list-buffers-directory))) | 699 | (if (or (eq buffer standard-output) |
| 700 | (list buffer | 700 | buffer-read-only) |
| 701 | (format "%c%c%c " | 701 | ?% ?\ ) |
| 702 | (if (eq buffer old-buffer) ?. ? ) | 702 | ;; Identify modified buffers. |
| 703 | ;; Handle readonly status. The output buffer is special | 703 | (if (buffer-modified-p) ?* ?\ ) |
| 704 | ;; cased to appear readonly; it is actually made so at a | 704 | ;; Space separator. |
| 705 | ;; later date. | 705 | ?\ ))) |
| 706 | (if (or (eq buffer standard-output) | 706 | (unless file |
| 707 | buffer-read-only) | 707 | ;; No visited file. Check local value of |
| 708 | ?% ? ) | 708 | ;; list-buffers-directory. |
| 709 | ;; Identify modified buffers. | 709 | (when (and (boundp 'list-buffers-directory) |
| 710 | (if (buffer-modified-p) ?* ? )) | 710 | list-buffers-directory) |
| 711 | name (buffer-size) mode file))))) | 711 | (setq file list-buffers-directory))) |
| 712 | (buffer-list))))) | 712 | (push (list buffer bits name (buffer-size) mode file) |
| 713 | list))))))) | ||
| 714 | ;; Preserve the original buffer-list ordering, just in case. | ||
| 715 | (setq list (nreverse list))) | ||
| 716 | ;; Place the buffers's info in the output buffer, sorted if necessary. | ||
| 713 | (dolist (buffer | 717 | (dolist (buffer |
| 714 | (if Buffer-menu-sort-column | 718 | (if Buffer-menu-sort-column |
| 715 | (sort list | 719 | (sort list |
| @@ -754,5 +758,5 @@ For more information, see the function `buffer-menu'." | |||
| 754 | (set-buffer-modified-p nil) | 758 | (set-buffer-modified-p nil) |
| 755 | (current-buffer)))) | 759 | (current-buffer)))) |
| 756 | 760 | ||
| 757 | ;;; arch-tag: e7dfcfc9-6cb2-46e4-bf55-8ef1936d83c6 | 761 | ;; arch-tag: e7dfcfc9-6cb2-46e4-bf55-8ef1936d83c6 |
| 758 | ;;; buff-menu.el ends here | 762 | ;;; buff-menu.el ends here |