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