• Mattias Engdegård's avatar
    Optional space and unit in `file-size-human-readable' (bug#35756) · 866f527d
    Mattias Engdegård authored
    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.
    866f527d
NEWS 84.1 KB