671 |
;; line with the beginning of the text (rather than with the left |
;; line with the beginning of the text (rather than with the left |
672 |
;; scrollbar or the left fringe). –-Stef |
;; scrollbar or the left fringe). –-Stef |
673 |
(setq header (concat (propertize " " 'display '(space :align-to 0)) |
(setq header (concat (propertize " " 'display '(space :align-to 0)) |
674 |
header)) |
header))) |
|
) |
|
675 |
(with-current-buffer (get-buffer-create "*Buffer List*") |
(with-current-buffer (get-buffer-create "*Buffer List*") |
676 |
(setq buffer-read-only nil) |
(setq buffer-read-only nil) |
677 |
(erase-buffer) |
(erase-buffer) |
683 |
(mapcar (lambda (c) |
(mapcar (lambda (c) |
684 |
(if (memq c '(?\n ?\ )) c underline)) |
(if (memq c '(?\n ?\ )) c underline)) |
685 |
header))))) |
header))))) |
686 |
(if buffer-list |
;; Collect info for every buffer we're interested in. |
687 |
(setq list buffer-list) |
(dolist (buffer (or buffer-list (buffer-list))) |
688 |
;; Collect info for every buffer we're interested in. |
(with-current-buffer buffer |
689 |
(dolist (buffer (buffer-list)) |
(let ((name (buffer-name)) |
690 |
(with-current-buffer buffer |
(file buffer-file-name)) |
691 |
(let ((name (buffer-name)) |
(unless (and (not buffer-list) |
692 |
(file buffer-file-name)) |
(or |
693 |
(cond |
;; Don't mention internal buffers. |
694 |
;; Don't mention internal buffers. |
(and (string= (substring name 0 1) " ") (null file)) |
695 |
((and (string= (substring name 0 1) " ") (null file))) |
;; Maybe don't mention buffers without files. |
696 |
;; Maybe don't mention buffers without files. |
(and files-only (not file)) |
697 |
((and files-only (not file))) |
(string= name "*Buffer List*"))) |
698 |
((string= name "*Buffer List*")) |
;; Otherwise output info. |
699 |
;; Otherwise output info. |
(let ((mode (concat (format-mode-line mode-name nil nil buffer) |
700 |
(t |
(if mode-line-process |
701 |
(let ((mode (concat (format-mode-line mode-name nil nil buffer) |
(format-mode-line mode-line-process |
702 |
(if mode-line-process |
nil nil buffer)))) |
703 |
(format-mode-line mode-line-process |
(bits (string |
704 |
nil nil buffer)))) |
(if (eq buffer old-buffer) ?. ?\ ) |
705 |
(bits (string |
;; Handle readonly status. The output buffer |
706 |
(if (eq buffer old-buffer) ?. ?\ ) |
;; is special cased to appear readonly; it is |
707 |
;; Handle readonly status. The output buffer |
;; actually made so at a later date. |
708 |
;; is special cased to appear readonly; it is |
(if (or (eq buffer standard-output) |
709 |
;; actually made so at a later date. |
buffer-read-only) |
710 |
(if (or (eq buffer standard-output) |
?% ?\ ) |
711 |
buffer-read-only) |
;; Identify modified buffers. |
712 |
?% ?\ ) |
(if (buffer-modified-p) ?* ?\ ) |
713 |
;; Identify modified buffers. |
;; Space separator. |
714 |
(if (buffer-modified-p) ?* ?\ ) |
?\ ))) |
715 |
;; Space separator. |
(unless file |
716 |
?\ ))) |
;; No visited file. Check local value of |
717 |
(unless file |
;; list-buffers-directory. |
718 |
;; No visited file. Check local value of |
(when (and (boundp 'list-buffers-directory) |
719 |
;; list-buffers-directory. |
list-buffers-directory) |
720 |
(when (and (boundp 'list-buffers-directory) |
(setq file list-buffers-directory))) |
721 |
list-buffers-directory) |
(push (list buffer bits name (buffer-size) mode file) |
722 |
(setq file list-buffers-directory))) |
list)))))) |
723 |
(push (list buffer bits name (buffer-size) mode file) |
;; Preserve the original buffer-list ordering, just in case. |
724 |
list))))))) |
(setq list (nreverse list)) |
|
;; Preserve the original buffer-list ordering, just in case. |
|
|
(setq list (nreverse list))) |
|
725 |
;; Place the buffers's info in the output buffer, sorted if necessary. |
;; Place the buffers's info in the output buffer, sorted if necessary. |
726 |
(dolist (buffer |
(dolist (buffer |
727 |
(if Buffer-menu-sort-column |
(if Buffer-menu-sort-column |