mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-03 10:53:23 +00:00
New user option 'Buffer-menu-human-readable-sizes'
* lisp/buff-menu.el (Buffer-menu-human-readable-sizes): New user option. (list-buffers--refresh): Use it. * etc/NEWS: Announce the new user option. (Bug#75825)
This commit is contained in:
parent
ed0ca7c23e
commit
f40aff4c5d
2 changed files with 18 additions and 1 deletions
6
etc/NEWS
6
etc/NEWS
|
@ -402,6 +402,12 @@ set to 'title'.
|
||||||
*** New user option 'ibuffer-human-readable-size'.
|
*** New user option 'ibuffer-human-readable-size'.
|
||||||
When non-nil, buffer sizes are shown in human readable format.
|
When non-nil, buffer sizes are shown in human readable format.
|
||||||
|
|
||||||
|
---
|
||||||
|
** Buffer Menu
|
||||||
|
*** New user option 'Buffer-menu-human-readable-sizes'.
|
||||||
|
When non-nil, buffer sizes are shown in human readable format. The
|
||||||
|
default is nil, which retains the old format.
|
||||||
|
|
||||||
** Smerge
|
** Smerge
|
||||||
*** New command 'smerge-extend' extends a conflict over surrounding lines.
|
*** New command 'smerge-extend' extends a conflict over surrounding lines.
|
||||||
|
|
||||||
|
|
|
@ -135,6 +135,14 @@ If this is nil, group names are unsorted."
|
||||||
:group 'Buffer-menu
|
:group 'Buffer-menu
|
||||||
:version "30.1")
|
:version "30.1")
|
||||||
|
|
||||||
|
(defcustom Buffer-menu-human-readable-sizes nil
|
||||||
|
"If non-nil, show buffer sizes in human-readable format.
|
||||||
|
That means to use `file-size-human-readable' (which see) to format the
|
||||||
|
buffer sizes in the buffer size column."
|
||||||
|
:type 'boolean
|
||||||
|
:group 'Buffer-menu
|
||||||
|
:version "31.1")
|
||||||
|
|
||||||
(defvar-local Buffer-menu-files-only nil
|
(defvar-local Buffer-menu-files-only nil
|
||||||
"Non-nil if the current Buffer Menu lists only file buffers.
|
"Non-nil if the current Buffer Menu lists only file buffers.
|
||||||
This is set by the prefix argument to `buffer-menu' and related
|
This is set by the prefix argument to `buffer-menu' and related
|
||||||
|
@ -831,7 +839,10 @@ See more at `Buffer-menu-filter-predicate'."
|
||||||
(if buffer-read-only "%" " ")
|
(if buffer-read-only "%" " ")
|
||||||
(if (buffer-modified-p) "*" " ")
|
(if (buffer-modified-p) "*" " ")
|
||||||
(Buffer-menu--pretty-name name)
|
(Buffer-menu--pretty-name name)
|
||||||
(number-to-string (buffer-size))
|
(funcall (if Buffer-menu-human-readable-sizes
|
||||||
|
#'file-size-human-readable
|
||||||
|
#'number-to-string)
|
||||||
|
(buffer-size))
|
||||||
(concat (format-mode-line mode-name
|
(concat (format-mode-line mode-name
|
||||||
nil nil buffer)
|
nil nil buffer)
|
||||||
(if mode-line-process
|
(if mode-line-process
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue