[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: Basil L. Contovounesios
Subject: Re: [Emacs-diffs] master fd54102: * lisp/files.el (file-size-function): New defcustom
Date: Fri, 26 Jul 2019 15:39:15 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Mattias Engdegård <address@hidden> writes:

> 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.

Only some minor nits from me:

> +(defun file-size-human-readable-iec (size)
> +  "Human-readable string for SIZE bytes, using IEC prefixes."
> +  (file-size-human-readable size 'iec " "))
> +
> +(defcustom byte-count-to-string-function #'file-size-human-readable-iec
> +  "Function that turns a number of bytes into a human-readable string.
> +It is for use when displaying file sizes and disk space where other
> +constraints do not force a specific format."
> +  :type `(radio

The backtick no longer seems necessary.

> +          (function-item :tag "IEC" file-size-human-readable-iec)
> +          (function-item :tag "Traditional" file-size-human-readable)

Isn't :tag a no-op for function-items?

> +          (function :tag "Custom function" number-to-string))

This seems to work, but my reading of the manual is that
number-to-string must be given as the value of the :value tag, not on
its own.  Does the manual need updating in this regard?



reply via email to

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