unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Oleh Krehel <ohwoeowho@gmail.com>
To: "Mattias Engdegård" <mattiase@acm.org>
Cc: "Basil L. Contovounesios" <contovob@tcd.ie>,
	Eli Zaretskii <eliz@gnu.org>, emacs-devel <emacs-devel@gnu.org>
Subject: Re: [Emacs-diffs] master fd54102: * lisp/files.el (file-size-function): New defcustom
Date: Mon, 22 Jul 2019 18:15:38 +0200	[thread overview]
Message-ID: <CAA01p3qDg+B2gRcV2qKQSjLSA7rqsudArbmevp4a4S6C+x6upw@mail.gmail.com> (raw)
In-Reply-To: <B53B40CA-AFF5-4C32-A67C-277FA1F44FB6@acm.org>

> 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	other threads:[~2019-07-22 16:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190719165710.17673.32987@vcs0.savannah.gnu.org>
     [not found] ` <20190719165711.741F1206A7@vcs0.savannah.gnu.org>
2019-07-20 16:53   ` [Emacs-diffs] master fd54102: * lisp/files.el (file-size-function): New defcustom Basil L. Contovounesios
2019-07-20 17:06     ` Eli Zaretskii
2019-07-20 17:38       ` Oleh Krehel
2019-07-20 17:45         ` Eli Zaretskii
2019-07-20 17:50           ` Oleh Krehel
2019-07-20 17:56             ` Eli Zaretskii
2019-07-20 18:50         ` Basil L. Contovounesios
2019-07-22 15:26           ` Mattias Engdegård
2019-07-22 16:15             ` Oleh Krehel [this message]
2019-07-22 20:14               ` Stefan Monnier
2019-07-26 10:43                 ` Mattias Engdegård
2019-07-26 14:39                   ` Basil L. Contovounesios
2019-07-26 21:39                     ` Mattias Engdegård
2019-07-22 17:29             ` Eli Zaretskii
2019-07-20 17:30     ` Mattias Engdegård
2019-07-20 18:48       ` Basil L. Contovounesios
2019-07-20 19:06         ` Mattias Engdegård

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAA01p3qDg+B2gRcV2qKQSjLSA7rqsudArbmevp4a4S6C+x6upw@mail.gmail.com \
    --to=ohwoeowho@gmail.com \
    --cc=contovob@tcd.ie \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=mattiase@acm.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).