emacs-devel
[Top][All Lists]
Advanced

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

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


From: Oleh Krehel
Subject: Re: [Emacs-diffs] master fd54102: * lisp/files.el (file-size-function): New defcustom
Date: Mon, 22 Jul 2019 18:15:38 +0200

> Agreed, and this defcustom (file-size-function) has a much more 
> general-sounding name and description than merited by its effects (which are 
> limited to the "available disk space" number in Dired and that's it).

The name is fine in my opinion. It's a derivation of
`file-size-human-readable'. The postfix "-function" means it's a
customizable variable that will be `funcall'-ed. Here's how it works:

    (defcustom ediff-window-setup-function #'ediff-setup-windows-default
      "..."
      :type '(choice
              (const ediff-setup-windows-default)
              (const ediff-setup-windows-multiframe)
              (const ediff-setup-windows-plain)
              (function :tag "Other function")))

Ideally, just from the name `ediff-window-setup-function', we know
which values it can assume.  As is the case for `file-size-function':
it can assume a value 'file-size-human-readable', they share the same
prefix.

In addition, the function is used for available space in Dired only
*now*. In the future it can be used in other places as well. And the
users will benefit of being able to customize how file sizes are
shown.

> Attached is a minimal clean-up which remedies some of the flaws, but perhaps 
> we should instead roll back the defcustom and all related changes entirely 
> until a cohesive proposal is forthcoming, as per your and Eli's comments. 
> Fighting it out in the source isn't really going to be productive.

Yet it's exactly what you're trying to do with your patch! Once again,
you try to have the default format be:

    total used in directory 153M available 496.4 GiB

in place of the more common one produced by "df -kh ." or "du -hs .".

    total used in directory 153M available 496.4G

regards,
Oleh



reply via email to

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