(list-buffers-noselect): Collect internal info
for every buffer in BUFFER-LIST arg too.
This commit is contained in:
parent
37d8fcc253
commit
a6a2fd5e30
1 changed files with 40 additions and 43 deletions
|
@ -671,8 +671,7 @@ For more information, see the function `buffer-menu'."
|
|||
;; line with the beginning of the text (rather than with the left
|
||||
;; scrollbar or the left fringe). –-Stef
|
||||
(setq header (concat (propertize " " 'display '(space :align-to 0))
|
||||
header))
|
||||
)
|
||||
header)))
|
||||
(with-current-buffer (get-buffer-create "*Buffer List*")
|
||||
(setq buffer-read-only nil)
|
||||
(erase-buffer)
|
||||
|
@ -684,21 +683,19 @@ For more information, see the function `buffer-menu'."
|
|||
(mapcar (lambda (c)
|
||||
(if (memq c '(?\n ?\ )) c underline))
|
||||
header)))))
|
||||
(if buffer-list
|
||||
(setq list buffer-list)
|
||||
;; Collect info for every buffer we're interested in.
|
||||
(dolist (buffer (buffer-list))
|
||||
(dolist (buffer (or buffer-list (buffer-list)))
|
||||
(with-current-buffer buffer
|
||||
(let ((name (buffer-name))
|
||||
(file buffer-file-name))
|
||||
(cond
|
||||
(unless (and (not buffer-list)
|
||||
(or
|
||||
;; Don't mention internal buffers.
|
||||
((and (string= (substring name 0 1) " ") (null file)))
|
||||
(and (string= (substring name 0 1) " ") (null file))
|
||||
;; Maybe don't mention buffers without files.
|
||||
((and files-only (not file)))
|
||||
((string= name "*Buffer List*"))
|
||||
(and files-only (not file))
|
||||
(string= name "*Buffer List*")))
|
||||
;; Otherwise output info.
|
||||
(t
|
||||
(let ((mode (concat (format-mode-line mode-name nil nil buffer)
|
||||
(if mode-line-process
|
||||
(format-mode-line mode-line-process
|
||||
|
@ -722,9 +719,9 @@ For more information, see the function `buffer-menu'."
|
|||
list-buffers-directory)
|
||||
(setq file list-buffers-directory)))
|
||||
(push (list buffer bits name (buffer-size) mode file)
|
||||
list)))))))
|
||||
list))))))
|
||||
;; Preserve the original buffer-list ordering, just in case.
|
||||
(setq list (nreverse list)))
|
||||
(setq list (nreverse list))
|
||||
;; Place the buffers's info in the output buffer, sorted if necessary.
|
||||
(dolist (buffer
|
||||
(if Buffer-menu-sort-column
|
||||
|
|
Loading…
Add table
Reference in a new issue