[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] master fd54102: * lisp/files.el (file-size-function):

From: Mattias Engdegård
Subject: Re: [Emacs-diffs] master fd54102: * lisp/files.el (file-size-function): New defcustom
Date: Fri, 26 Jul 2019 12:43:45 +0200

22 juli 2019 kl. 22.14 skrev Stefan Monnier <address@hidden>:
> FWIW, I agree that the name is slightly misleading, in that it seems to
> expect a function which takes a file name and returns the size of the
> file (most naturally represented as an integer number of bytes).
> So maybe something like `file-size-human-readable-function` is a better
> choice (then make file-size-human-readable call it and rename the
> current body of file-size-human-readable to something else,
> e.g. file-size-human-readable--default tho maybe that name shouldn't
> include "file" since it can also be used for other sizes).

Right, it is also intended for describing disk space, memory usage, etc. Given 
that, I ended up with `byte-count-to-string-function' which is passable but 
doesn't feel entirely satisfactory. Better name suggestions are welcome.

Since `file-size-human-readable' is used outside Emacs and a change in 
semantics might break assumptions, I left it untouched. Instead, most calls to 
that function were replaced with (function byte-count-to-string SIZE). If you 
would rather that we add a function for this (byte-count-to-string, maybe) 
instead of using the variable directly, this can be arranged.

22 juli 2019 kl. 19.29 skrev Eli Zaretskii <address@hidden>:
> Thanks.  Please consider calling this out in NEWS and maybe also in
> the ELisp manual.

NEWS updated; thanks for reminding me. I couldn't find a natural place for it 
in the manual.

Oleh, you had strong personal preferences for a particular format, and the 
customisable variable should now accommodate your wishes in more places than 
before. The default format was chosen for readability and standards compliance, 
and for being unambiguous.

Attachment: 0001-Clean-up-file-size-function.patch
Description: Binary data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]