From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: master 2b97e83cc1 2/2: Fix off-by-one file size formatting in ls-lisp Date: Mon, 14 Feb 2022 14:19:03 +0200 Message-ID: <83o839prns.fsf@gnu.org> References: <164464970577.18616.16858189491672331595@vcs2.savannah.gnu.org> <20220212070826.4B772C00895@vcs2.savannah.gnu.org> <83y22frjpy.fsf@gnu.org> <83tud3ri2n.fsf@gnu.org> <83r187rhd8.fsf@gnu.org> <83pmnrqo5m.fsf@gnu.org> <87h793yxtm.fsf@gnus.org> <83h793q7r5.fsf@gnu.org> <874k53uen1.fsf@gnus.org> <83ee47q636.fsf@gnu.org> <838ruerika.fsf@gnu.org> <87y22dsoz9.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14788"; mail-complaints-to="usenet@ciao.gmane.io" Cc: salutis@me.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Feb 14 13:28:55 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nJaTP-0003cE-4K for ged-emacs-devel@m.gmane-mx.org; Mon, 14 Feb 2022 13:28:55 +0100 Original-Received: from localhost ([::1]:36928 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nJaTM-0003UQ-OJ for ged-emacs-devel@m.gmane-mx.org; Mon, 14 Feb 2022 07:28:52 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44718) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJaJu-0001bk-5S for emacs-devel@gnu.org; Mon, 14 Feb 2022 07:19:06 -0500 Original-Received: from [2001:470:142:3::e] (port=56826 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJaJs-0001Wv-W3; Mon, 14 Feb 2022 07:19:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=LbIu4z6Pz/kIA01fpGOyUJYS2fbyo+Wt+p40zM90h+Q=; b=KBVrjxV52wHQ LWPUhzqdPTGIqtMtWIJ/+f9XiHSAL/NsHLgoj6LhgC6jSDAaSoyjoxT9/eNigMHMTMOzQHW7YbR1X TOnrbfDZtfNpPaMjrgAYfgfKrLli0Z/flG8nkeJY6KnWBPnX135X4KazZIF9/3QWG1bOt3z+rBD4D F1OUdiPssXS7qT2RhgEf4DNxJX+DuSjy5nMEWTVugSputs92NrKKTju60W9r6AqGSw52Wfb4QshRn qx9QAxeIjoScIwouCGUggw3vuzye1WU9Zi0ypc/9bTUrGs5ZXVnkjAAe3B3i6R2HgK5KhhzbPBRbv 3Klrfa6jo4VbzKK1ch70jA==; Original-Received: from [87.69.77.57] (port=4998 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJaJs-0004A4-A0; Mon, 14 Feb 2022 07:19:04 -0500 In-Reply-To: <87y22dsoz9.fsf@gnus.org> (message from Lars Ingebrigtsen on Mon, 14 Feb 2022 11:48:42 +0100) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:286254 Archived-At: > From: Lars Ingebrigtsen > Cc: salutis@me.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org > Date: Mon, 14 Feb 2022 11:48:42 +0100 > > Eli Zaretskii writes: > > > So how about the patch below: > > > > diff --git a/lisp/files.el b/lisp/files.el > > index cfa1a59..7e62726 100644 > > --- a/lisp/files.el > > +++ b/lisp/files.el > > @@ -1494,7 +1494,8 @@ file-size-human-readable > > (or unit "B")) > > (concat prefix unit)))) > > (format (if (and (>= (mod file-size 1.0) 0.05) > > - (< (mod file-size 1.0) 0.95)) > > + (< (mod file-size 1.0) 0.95) > > + (< file-size 10)) > > Possibly, but it's hard to tell... perhaps a better test is whether the > printed representation is longer than 6 characters, and then precision > should be reduced. I thought we wanted to mimic what GNU 'ls' does? AFAICT, it shows the fractional part only for values whose integral part is less than 10, i.e. takes just one digit. So that's what the above change does. If you run "ls -lh" on a large directory, do you see something different from my description above?