From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master fd54102: * lisp/files.el (file-size-function): New defcustom Date: Sat, 20 Jul 2019 17:53:13 +0100 Message-ID: <87tvbgabra.fsf@tcd.ie> References: <20190719165710.17673.32987@vcs0.savannah.gnu.org> <20190719165711.741F1206A7@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="222134"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Oleh Krehel To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 20 18:53:25 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hosbs-000vfP-Ix for ged-emacs-devel@m.gmane.org; Sat, 20 Jul 2019 18:53:24 +0200 Original-Received: from localhost ([::1]:52160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hosbr-0005fJ-5Y for ged-emacs-devel@m.gmane.org; Sat, 20 Jul 2019 12:53:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59443) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hosbn-0005eQ-QF for emacs-devel@gnu.org; Sat, 20 Jul 2019 12:53:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hosbm-0004Wn-Rm for emacs-devel@gnu.org; Sat, 20 Jul 2019 12:53:19 -0400 Original-Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:38391) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hosbm-0004Uj-Cu for emacs-devel@gnu.org; Sat, 20 Jul 2019 12:53:18 -0400 Original-Received: by mail-wr1-x436.google.com with SMTP id g17so35174239wrr.5 for ; Sat, 20 Jul 2019 09:53:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=t+QHdhGoSUNaEyuoW6Mvi6uHQUxc6M5qAhTzPb8jAGk=; b=NIBG9jS253y4RekDl2W63W067NCVof/L9USULvZ9s7MWyumwhhgcIsEzA1aGWWeW/0 xzqd9q8aSUrdjvSBokNMfaxTe767XCzeFQ50RR96gWyX7dTTWi/RopHTvqkWN7/qiAcJ gsjSshtoVBKFQwm6raaCB3lO0uBiNiZwupryGJqepTW+VsS52XUd+keoUd8ediYFzDYK oqfkZjEvNRf1m4QEbVIqhX2hXyiaUcS3fpghnn8Mf6viefHPQCh1RTQePSLTYzf12mwF OcQ5ndvTDhz8UQ22TaqZ56n4kyFC5TJVqvSJL0QGSewDeFlHfZCoslRIrxpmJnG66kJz z1Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=t+QHdhGoSUNaEyuoW6Mvi6uHQUxc6M5qAhTzPb8jAGk=; b=C9NmUnbaKZ/Rv/NMhVRqSEDpdq2UBWtK9ls2VqduSlJmDXQnO/ocD8ok2vEYn/lkN0 zHNOS1y2jjS/C/spQPD1RQZ6u4lFLwFyMiEQMLfWFWPsXc8ABE2n0CagoEzUxXJHZyky yxhH+9QpOgAhs9LCsCm1p766zZW6N+XMB6SxYM9M2yFEvpbaFIUv2lmhk9dpir7Z7pA0 bgyhFGdzTzRExg4zvynejAHWK94TzhvXuzNlHzq838XHV//QKmdELdspezg38PAgeAET 7XsvTpG05/GrTd79Si4xGA73lAfer1X2PodX2r9E4/GsCD57BhJlOvALitTn7WMNRxj3 3jxw== X-Gm-Message-State: APjAAAVFuAJJGr5yVYY9psONFUkJJ4CPjenGMgHvHjJo6CY/2+whRqZI FlvLmzjMPdkhDT1Z6DEzH7FPy80SjBc= X-Google-Smtp-Source: APXvYqw6KYE78Y12pBfqMrht1jCf3HBn9S/XFjrlKbuofxiO2scD+utNSwfHmesiG9j33v6Sq1Lg4A== X-Received: by 2002:a05:6000:100f:: with SMTP id a15mr42961498wrx.325.1563641595688; Sat, 20 Jul 2019 09:53:15 -0700 (PDT) Original-Received: from localhost ([2a02:8084:20e2:c380:92bd:1bfd:38fc:fae2]) by smtp.gmail.com with ESMTPSA id z7sm29824956wrh.67.2019.07.20.09.53.14 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 20 Jul 2019 09:53:14 -0700 (PDT) In-Reply-To: <20190719165711.741F1206A7@vcs0.savannah.gnu.org> (Oleh Krehel's message of "Fri, 19 Jul 2019 12:57:11 -0400 (EDT)") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::436 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:238734 Archived-At: ohwoeowho@gmail.com (Oleh Krehel) writes: > branch: master > commit fd5410217ff23810edc16e97c10934ad622f8e4b > Author: Oleh Krehel > Commit: Oleh Krehel > > * lisp/files.el (file-size-function): New defcustom [I wish changes like this (and its recent predecessors, which caused test failues that others had to fix), even if small, to central user-facing features were instead discussed and tested a little before being unilaterally pushed.] > --- > etc/NEWS | 1 + > lisp/files.el | 10 +++++++++- > 2 files changed, 10 insertions(+), 1 deletion(-) > > diff --git a/etc/NEWS b/etc/NEWS > index c875fc6..5cbe60c 100644 > --- a/etc/NEWS > +++ b/etc/NEWS > @@ -400,6 +400,7 @@ mode they are described in the manual "(emacs) Display". > --- > ** New variable 'xref-file-name-display' controls the display of file > names in xref buffers. > +** New variable `file-size-function' controls how file sizes are displayed Which file sizes? > > * Editing Changes in Emacs 27.1 > diff --git a/lisp/files.el b/lisp/files.el > index 238aa37..e26b482 100644 > --- a/lisp/files.el > +++ b/lisp/files.el > @@ -6696,13 +6696,21 @@ This variable is obsolete; Emacs no longer uses it." > "ignored, as Emacs uses `file-system-info' instead" > "27.1") > > +(defcustom file-size-function #'file-size-human-readable > + "Function that transforms the number of bytes into a human-readable string." The number of which bytes? I think a phrase similar to "for display" would be more accurate than "human-readable" here. > + :type '(choice Did you try radio+function-item instead of choice+const? I usually find the former nicer, as recommended in (info "(elisp) Composite Types"). > + (const :tag "default" file-size-human-readable) > + (const :tag "iec" Nit: Please capitalise and uppercase these tags, respectively. > + (lambda (size) (file-size-human-readable size 'iec " "))) Please do not use an unevaluated anonymous function here. > + (function :tag "Custom function"))) > > (defun get-free-disk-space (dir) > "String describing the amount of free space on DIR's file system. > If DIR's free space cannot be obtained, this function returns nil." > (save-match-data > (let ((avail (nth 2 (file-system-info dir)))) > (if avail > - (file-size-human-readable avail 'iec " "))))) > + (funcall file-size-function avail))))) > > ;; The following expression replaces `dired-move-to-filename-regexp'. > (defvar directory-listing-before-filename-regexp Thanks for working on this, -- Basil