diff options
author | Mattias EngdegÄrd <mattiase@acm.org> | 2019-05-13 17:05:24 +0200 |
---|---|---|
committer | Mattias EngdegÄrd <mattiase@acm.org> | 2019-06-23 20:30:50 +0200 |
commit | 866f527ddf21050a827fa47e04cfe6163f1c7053 (patch) | |
tree | 411dae7879dc84717f0bfd11087633d32762b5a7 /lisp/emacs-lisp/shadow.el | |
parent | b439b3bb5a44bc61cec3f5c8e3e3ea37760dfb29 (diff) | |
download | emacs-866f527ddf21050a827fa47e04cfe6163f1c7053.tar.gz emacs-866f527ddf21050a827fa47e04cfe6163f1c7053.tar.bz2 emacs-866f527ddf21050a827fa47e04cfe6163f1c7053.zip |
Optional space and unit in `file-size-human-readable' (bug#35756)
To improve readability of strings produced by
`file-size-human-readable', add two optional arguments:
- SPACE, to provide a string (typically a space or non-breaking space)
to put between the number and unit. For compatibility, the default is
an empty string.
- UNIT, a string to use as unit. For compatibility, the default is
"B" in `iec' mode and the empty string otherwise.
Also fix a glitch with small numbers in `iec' mode which caused a
stray "i" in the result.
* lisp/files.el (file-size-human-readable):
Add optional SPACE and UNIT arguments and handle small numbers correctly.
(files--ask-user-about-large-file, warn-maybe-out-of-memory):
Call with `iec' and space.
* test/lisp/files-tests.el (files-test-file-size-human-readable): New test.
* lisp/url/url-http.el (url-http-simple-after-change-function)
(url-http-content-length-after-change-function): Call with `iec' and space.
* etc/NEWS (Lisp Changes): Mention the change.
Diffstat (limited to 'lisp/emacs-lisp/shadow.el')
0 files changed, 0 insertions, 0 deletions