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: Fri, 26 Jul 2019 15:39:15 +0100 Message-ID: <87pnlw6ess.fsf@tcd.ie> References: <20190719165710.17673.32987@vcs0.savannah.gnu.org> <20190719165711.741F1206A7@vcs0.savannah.gnu.org> <87tvbgabra.fsf@tcd.ie> <83k1ccskic.fsf@gnu.org> <87sgr07d6e.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="98844"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Eli Zaretskii , emacs-devel , Stefan Monnier , Oleh Krehel To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 26 16:39:30 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 1hr1Na-000Pbi-7P for ged-emacs-devel@m.gmane.org; Fri, 26 Jul 2019 16:39:30 +0200 Original-Received: from localhost ([::1]:40618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hr1NZ-00070V-3T for ged-emacs-devel@m.gmane.org; Fri, 26 Jul 2019 10:39:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34526) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hr1NR-000706-Eo for emacs-devel@gnu.org; Fri, 26 Jul 2019 10:39:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hr1NQ-0001Rg-Em for emacs-devel@gnu.org; Fri, 26 Jul 2019 10:39:21 -0400 Original-Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:40140) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hr1NQ-0001Om-2d for emacs-devel@gnu.org; Fri, 26 Jul 2019 10:39:20 -0400 Original-Received: by mail-wr1-x42f.google.com with SMTP id r1so54693806wrl.7 for ; Fri, 26 Jul 2019 07:39:19 -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:content-transfer-encoding; bh=5Ewy4jNuyrxy8lqURSGq5g3uB1i2h+Ipg0rP0aJB0co=; b=SctIyNDUugHd9n49HlmCdm8kEBOLPIez2u7gguWo3KTbtBfd5J1tSs2eAYWewT2kPK Z0aix8uEkDgsUejfrNKvACF/67iCh2gHTrW0d57ANAvtNhdsWhJoBaQktAFtLCTV6iiQ CHq8KjxE2xZqyac+5scqNJRmkKY5qSLtv11zgyTYyWmr2qi5b4AnEgiNZHBqnNxVk7n2 t1v8PtOEQ0uHmDKk3p3DDH7OaanYJvb4y/sfh5WnEhkS20BU/Bc0V3tm+1mfeHSrPa1U 2bcOsnT2gNO7EBUhXKmQRrnNhunJwr2thTwpayRAYcXWGj/CEvgR9tj8eSUExE7JiC2O oXXA== 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:content-transfer-encoding; bh=5Ewy4jNuyrxy8lqURSGq5g3uB1i2h+Ipg0rP0aJB0co=; b=ZlwyKddpl9rfp0VgRXbPSk1yiQqx/ERWvbsNTCNh3njtolZfMo2zscH6t5fxz4Wbr7 ib6gTR2GDQyXl2ltJUWsuHN9MWOWGh0LmMW3LkCdAN8PcfEt+8162mhAXOVA9yb4JGG7 RsS+9XH7a4QPT1tDi2ejURIT7rcMgVnpJE0wVfieQIOFf6zGLd5/kf8jaGcwpQmzbpfM 4ClvdvovjlxKCQkuPROJv97fInQTYQK+lS6v8AJyce38H7QShzoVJ+H0/jxWD+ZcEFa4 Ic1DhdzDOlmp+sGtOfFFp2C1+XEpQeF6IPiVAs2A8BT+Rl+2ArRmzGo1DSBKWBva1+36 TMgw== X-Gm-Message-State: APjAAAX5LOoLhQiX5JA+9P/Bmet/LgiXm1pAdtQEn/m/V3uGwlYUTW+w AOP+c2gohVEUQsJs+t/A9yql+g== X-Google-Smtp-Source: APXvYqzMDAwlFN4vHcuq59SsXwdn9ZvEQ8Pdtn58FKMmIEj3pJt+13Lk6NSkgMH+SVCKLqWKD/DIEA== X-Received: by 2002:a05:6000:1189:: with SMTP id g9mr65769609wrx.51.1564151957717; Fri, 26 Jul 2019 07:39:17 -0700 (PDT) Original-Received: from localhost ([89.101.223.218]) by smtp.gmail.com with ESMTPSA id o26sm106103027wro.53.2019.07.26.07.39.16 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 26 Jul 2019 07:39:16 -0700 (PDT) In-Reply-To: ("Mattias =?utf-8?Q?Engdeg=C3=A5rd=22's?= message of "Fri, 26 Jul 2019 12:43:45 +0200") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42f 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:238930 Archived-At: Mattias Engdeg=C3=A5rd 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 b= ut > 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? Thanks, --=20 Basil