From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#35756: [PATCH] file-size-human-readable: fix glitches and add optional space Date: Wed, 15 May 2019 22:02:50 +0200 Message-ID: <28D42987-D855-4213-9111-DB01E0753D9A@acm.org> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_2BFCA44F-6612-4B8A-8A1E-098E52547D0D" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="253299"; mail-complaints-to="usenet@blaine.gmane.org" To: 35756@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 15 22:11:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hR0F5-0013lm-57 for geb-bug-gnu-emacs@m.gmane.org; Wed, 15 May 2019 22:11:11 +0200 Original-Received: from localhost ([127.0.0.1]:41839 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0F4-0004if-51 for geb-bug-gnu-emacs@m.gmane.org; Wed, 15 May 2019 16:11:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:44069) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0Ex-0004iP-MA for bug-gnu-emacs@gnu.org; Wed, 15 May 2019 16:11:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hR0Ew-0003mx-Je for bug-gnu-emacs@gnu.org; Wed, 15 May 2019 16:11:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39899) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hR0Ew-0003mf-9l for bug-gnu-emacs@gnu.org; Wed, 15 May 2019 16:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hR0Ew-0000FT-1z for bug-gnu-emacs@gnu.org; Wed, 15 May 2019 16:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 May 2019 20:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35756 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.1557951019893 (code B ref -1); Wed, 15 May 2019 20:11:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 May 2019 20:10:19 +0000 Original-Received: from localhost ([127.0.0.1]:53443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hR0EF-0000EK-18 for submit@debbugs.gnu.org; Wed, 15 May 2019 16:10:19 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57798) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hR0EB-0000E3-Pj for submit@debbugs.gnu.org; Wed, 15 May 2019 16:10:16 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:43456) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hR0E6-0002fz-Kn for submit@debbugs.gnu.org; Wed, 15 May 2019 16:10:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43946) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hR0E5-0004JX-85 for bug-gnu-emacs@gnu.org; Wed, 15 May 2019 16:10:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hR0E4-0002Zo-4b for bug-gnu-emacs@gnu.org; Wed, 15 May 2019 16:10:09 -0400 Original-Received: from mail1427c50.megamailservers.eu ([91.136.14.27]:47956 helo=mail118c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hR0E3-0002WM-JL for bug-gnu-emacs@gnu.org; Wed, 15 May 2019 16:10:08 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1557950572; bh=fO7I8TCf8Sq7cVhyWTyazgF5n9bmJOWFCNqIMfQ6R48=; h=From:Subject:Date:To:From; b=sy5NGn55sIP9/ig7psk0el5Gs89//gEtnJBjIeflWJ5z8c89Bm81WmwfheaeB0GU8 aIUXXD9vLzC7R7Ks30W8wXEbFeFPow/tTKAkfYEd8GZXlX5rLwO0RjQ/scX0QroDbZ Mv2almq+l9KhTHCY9AFVmjDl6h/nA0AFNyW6l1xQ= Feedback-ID: mattiase@acm.or Original-Received: from [192.168.1.65] (c-e636e253.032-75-73746f71.bbcust.telenor.se [83.226.54.230]) (authenticated bits=0) by mail118c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x4FK2ofP023761 for ; Wed, 15 May 2019 20:02:52 +0000 X-Mailer: Apple Mail (2.3445.104.8) X-CTCH-RefID: str=0001.0A0B0205.5CDC706C.002A, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=PfPReBpd c=1 sm=1 tr=0 a=M+GU/qJco4WXjv8D6jB2IA==:117 a=M+GU/qJco4WXjv8D6jB2IA==:17 a=wpN-pL5C-qlI0s3A4lgA:9 a=Zx97rEhAQJ8ZJL_i:21 a=yPZoQU8bwY9aWpWD:21 a=CjuIK1q_8ugA:10 a=FL5RwxRrSzOq-IwuSK4A:9 a=B2y7HmGcmWMA:10 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:159355 Archived-At: --Apple-Mail=_2BFCA44F-6612-4B8A-8A1E-098E52547D0D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii The `file-size-human-readable' function is very useful but could do with = some better formatting: normally, a space goes between the number and = unit; you don't write '3kg' or '25m/s' but '3 kg' and '25 m/s' (sloppy = British newspapers notwithstanding). We could add an optional argument = so that the caller can use the spacing of preference; the default should = probably be no space, for compatibility. For some reason, only the `iec' mode adds an actual unit (B) to the = result; the default and `si' modes just append a scale prefix. Of course = a user can append the unit of choice, as in: (concat (file-size-human-readable size 'si) "B") which permits the function to be used for other units than bytes, such = as "bit/s" (although the name makes it clear that it is intended for = file sizes only). However, spacing complicates things, since we want (file-size-human-readable 14 'si " ") to return "14", not "14 ", but the latter is what we need when appending = the unit. I'm not sure how to fix this. We could add another optional argument, = UNIT say, which is the string to use as unit, defaulting to "B" in `iec' = mode and the empty string otherwise. The attached patch does not address = this. There is also a small glitch to be fixed: (file-size-human-readable 3 'iec) =3D> "3iB" which of course should be "3B". --Apple-Mail=_2BFCA44F-6612-4B8A-8A1E-098E52547D0D Content-Disposition: attachment; filename=0001-Optional-space-in-file-size-human-readable.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Optional-space-in-file-size-human-readable.patch" Content-Transfer-Encoding: quoted-printable =46rom=209b4cce48e39ecf6261c2a2104425c0f276935a13=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20= =0ADate:=20Mon,=2013=20May=202019=2017:05:24=20+0200=0A= Subject:=20[PATCH]=20Optional=20space=20in=20`file-size-human-readable'=0A= =0ATo=20improve=20readability=20of=20strings=20produced=20by=0A= `file-size-human-readable',=20add=20an=20optional=20argument=20to=20= provide=20a=0Astring=20(typically=20a=20space=20or=20non-breaking=20= space)=20to=20put=20between=20the=0Anumber=20and=20unit.=20=20For=20= compatibility,=20the=20default=20is=20an=20empty=20string.=0A=0AAlso=20= fix=20a=20glitch=20with=20small=20numbers=20in=20`iec'=20mode=20which=20= caused=20a=0Astray=20"i"=20in=20the=20result.=0A=0A*=20lisp/files.el=20= (file-size-human-readable):=0AAdd=20optional=20SPACE=20argument=20and=20= handle=20small=20numbers=20correctly.=0A= (files--ask-user-about-large-file,=20warn-maybe-out-of-memory):=0AUse=20= the=20new=20argument.=0A*=20lisp/url/url-http.el=20= (url-http-simple-after-change-function)=0A= (url-http-content-length-after-change-function):=0AUse=20the=20new=20= argument.=0A*=20etc/NEWS=20(Lisp=20Changes):=20Mention=20the=20change.=0A= ---=0A=20etc/NEWS=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20|=20=20= 6=20+++++=0A=20lisp/files.el=20=20=20=20=20=20=20=20=20=20=20=20|=2047=20= +++++++++++++++++++++++++---------------=0A=20lisp/url/url-http.el=20=20=20= =20=20|=2011=20+++++-----=0A=20test/lisp/files-tests.el=20|=2020=20= +++++++++++++++++=0A=204=20files=20changed,=2061=20insertions(+),=2023=20= deletions(-)=0A=0Adiff=20--git=20a/etc/NEWS=20b/etc/NEWS=0Aindex=20= 699a04b524..66c1d7883d=20100644=0A---=20a/etc/NEWS=0A+++=20b/etc/NEWS=0A= @@=20-1994,6=20+1994,12=20@@=20case.=0A=20It=20is=20a=20convenient=20and=20= readable=20way=20to=20specify=20a=20regexp=20that=20should=0A=20not=20= match=20anything,=20and=20is=20as=20fast=20as=20any=20such=20regexp=20= can=20be.=0A=20=0A++++=0A+**=20The=20function=20= 'file-size-human-readable'=20accepts=20another=20optional=20argument.=0A= +The=20new=20third=20argument=20is=20a=20string=20put=20between=20the=20= number=20and=20unit;=0A+if=20nil=20or=20omitted,=20the=20empty=20string=20= is=20used.=20=20It=20is=20recommended=20to=20use=0A+a=20single=20space=20= or=20non-breaking=20space=20for=20readability.=0A+=0A=20=0C=0A=20*=20= Changes=20in=20Emacs=2027.1=20on=20Non-Free=20Operating=20Systems=0A=20=0A= diff=20--git=20a/lisp/files.el=20b/lisp/files.el=0Aindex=20= 8fa7f16de0..7a1bb9fcae=20100644=0A---=20a/lisp/files.el=0A+++=20= b/lisp/files.el=0A@@=20-1358,7=20+1358,7=20@@=20it=20means=20chase=20no=20= more=20than=20that=20many=20links=20and=20then=20stop."=0A=20=0A=20;;=20= A=20handy=20function=20to=20display=20file=20sizes=20in=20human-readable=20= form.=0A=20;;=20See=20http://en.wikipedia.org/wiki/Kibibyte=20for=20the=20= reference.=0A-(defun=20file-size-human-readable=20(file-size=20&optional=20= flavor)=0A+(defun=20file-size-human-readable=20(file-size=20&optional=20= flavor=20space)=0A=20=20=20"Produce=20a=20string=20showing=20FILE-SIZE=20= in=20human-readable=20form.=0A=20=0A=20Optional=20second=20argument=20= FLAVOR=20controls=20the=20units=20and=20the=20display=20format:=0A@@=20= -1368,24=20+1368,34=20@@=20Optional=20second=20argument=20FLAVOR=20= controls=20the=20units=20and=20the=20display=20format:=0A=20=20If=20= FLAVOR=20is=20`si',=20each=20kilobyte=20is=201000=20bytes=20and=20the=20= produced=20suffixes=0A=20=20=20=20=20are=20\"k\",=20\"M\",=20\"G\",=20= \"T\",=20etc.=0A=20=20If=20FLAVOR=20is=20`iec',=20each=20kilobyte=20is=20= 1024=20bytes=20and=20the=20produced=20suffixes=0A-=20=20=20=20are=20= \"KiB\",=20\"MiB\",=20\"GiB\",=20\"TiB\",=20etc."=0A+=20=20=20=20are=20= \"KiB\",=20\"MiB\",=20\"GiB\",=20\"TiB\",=20etc.=0A+=0A+Optional=20third=20= argument=20SPACE=20is=20a=20string=20put=20between=20the=20number=20and=20= unit.=0A+If=20nil=20or=20omitted,=20the=20empty=20string=20is=20used.=0A= +Recommended=20value=20is=20a=20single=20space=20or=20non-breaking=20= space,=20unless=20other=0A+constraints=20prohibit=20a=20space=20in=20= that=20position."=0A=20=20=20(let=20((power=20(if=20(or=20(null=20= flavor)=20(eq=20flavor=20'iec))=0A=20=09=09=20=20=201024.0=0A=20=09=09=20= 1000.0))=0A-=09(post-fixes=0A-=09=20;;=20none,=20kilo,=20mega,=20giga,=20= tera,=20peta,=20exa,=20zetta,=20yotta=0A-=09=20(list=20""=20"k"=20"M"=20= "G"=20"T"=20"P"=20"E"=20"Z"=20"Y")))=0A-=20=20=20=20(while=20(and=20(>=3D=20= file-size=20power)=20(cdr=20post-fixes))=0A+=09(prefixes=20'(""=20"k"=20= "M"=20"G"=20"T"=20"P"=20"E"=20"Z"=20"Y")))=0A+=20=20=20=20(while=20(and=20= (>=3D=20file-size=20power)=20(cdr=20prefixes))=0A=20=20=20=20=20=20=20= (setq=20file-size=20(/=20file-size=20power)=0A-=09=20=20=20=20post-fixes=20= (cdr=20post-fixes)))=0A-=20=20=20=20(format=20(if=20(>=20(mod=20= file-size=201.0)=200.05)=0A-=09=09"%.1f%s%s"=0A-=09=20=20=20=20=20=20= "%.0f%s%s")=0A-=09=20=20=20=20file-size=0A-=09=20=20=20=20(if=20(and=20= (eq=20flavor=20'iec)=20(string=3D=20(car=20post-fixes)=20"k"))=0A-=09=09= "K"=0A-=09=20=20=20=20=20=20(car=20post-fixes))=0A-=09=20=20=20=20(if=20= (eq=20flavor=20'iec)=20"iB"=20""))))=0A+=09=20=20=20=20prefixes=20(cdr=20= prefixes)))=0A+=20=20=20=20;;=20It's=20a=20bit=20inconsistent=20that=20= only=20`iec'=20includes=20an=20actual=20unit,=0A+=20=20=20=20;;=20while=20= the=20two=20other=20flavours=20just=20generate=20a=20prefix.=0A+=20=20=20= =20(let*=20((prefix=20(car=20prefixes))=0A+=20=20=20=20=20=20=20=20=20=20= =20(unit=20(if=20(eq=20flavor=20'iec)=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(concat=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(if=20(string=3D=20prefix=20"k")=20"K"=20= prefix)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(if=20(string-empty-p=20prefix)=20""=20"i")=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20"B")=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20prefix)))=0A+=20=20=20=20=20=20(format=20= (if=20(>=20(mod=20file-size=201.0)=200.05)=0A+=09=09=20=20"%.1f%s%s"=0A+=09= =20=20=20=20=20=20=20=20"%.0f%s%s")=0A+=09=20=20=20=20=20=20file-size=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20(if=20(string-empty-p=20unit)=20= ""=20(or=20space=20""))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= unit))))=0A=20=0A=20(defcustom=20mounted-file-systems=0A=20=20=20(if=20= (memq=20system-type=20'(windows-nt=20cygwin))=0A@@=20-2054,7=20+2064,7=20= @@=20think=20it=20does,=20because=20\"free\"=20is=20pretty=20hard=20to=20= define=20in=20practice."=0A=20(defun=20files--ask-user-about-large-file=20= (size=20op-type=20filename=20offer-raw)=0A=20=20=20(let=20((prompt=20= (format=20"File=20%s=20is=20large=20(%s),=20really=20%s?"=0A=20=09=09=20=20= =20=20=20=20=20=20(file-name-nondirectory=20filename)=0A-=09=09=20=20=20=20= =20=20=20=20(file-size-human-readable=20size)=20op-type)))=0A+=09=09=20=20= =20=20=20=20=20=20(file-size-human-readable=20size=20'iec=20"=20")=20= op-type)))=0A=20=20=20=20=20(if=20(not=20offer-raw)=0A=20=20=20=20=20=20=20= =20=20(if=20(y-or-n-p=20prompt)=20nil=20'abort)=0A=20=20=20=20=20=20=20= (let*=20((use-dialog=20(and=20(display-popup-menus-p)=0A@@=20-2106,9=20= +2116,10=20@@=20returns=20nil=20or=20exits=20non-locally."=0A=20exceeds=20= the=20%S%%=20of=20currently=20available=20free=20memory=20(%s).=0A=20If=20= that=20fails,=20try=20to=20open=20it=20with=20`find-file-literally'=0A=20= \(but=20note=20that=20some=20characters=20might=20be=20displayed=20= incorrectly)."=0A-=09=20=20=20=20=20(file-size-human-readable=20size)=0A= +=09=20=20=20=20=20(file-size-human-readable=20size=20'iec=20"=20")=0A=20= =09=20=20=20=20=20out-of-memory-warning-percentage=0A-=09=20=20=20=20=20= (file-size-human-readable=20(*=20total-free-memory=201024)))))))))=0A+=09= =20=20=20=20=20(file-size-human-readable=20(*=20total-free-memory=20= 1024)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20'iec=20"=20"))))))))=0A= =20=0A=20(defun=20files--message=20(format=20&rest=20args)=0A=20=20=20= "Like=20`message',=20except=20sometimes=20don't=20print=20to=20= minibuffer.=0Adiff=20--git=20a/lisp/url/url-http.el=20= b/lisp/url/url-http.el=0Aindex=2048e29987a5..d5d44190e1=20100644=0A---=20= a/lisp/url/url-http.el=0A+++=20b/lisp/url/url-http.el=0A@@=20-999,7=20= +999,8=20@@=20should=20be=20shown=20to=20the=20user."=0A=20(defun=20= url-http-simple-after-change-function=20(_st=20_nd=20_length)=0A=20=20=20= ;;=20Function=20used=20when=20we=20do=20NOT=20know=20how=20long=20the=20= document=20is=20going=20to=20be=0A=20=20=20;;=20Just=20_very_=20simple=20= 'downloaded=20%d'=20type=20of=20info.=0A-=20=20(url-lazy-message=20= "Reading=20%s..."=20(file-size-human-readable=20(buffer-size))))=0A+=20=20= (url-lazy-message=20"Reading=20%s..."=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(file-size-human-readable=20(buffer-size)=20= 'iec=20"=20")))=0A=20=0A=20(defun=20= url-http-content-length-after-change-function=20(_st=20nd=20_length)=0A=20= =20=20"Function=20used=20when=20we=20DO=20know=20how=20long=20the=20= document=20is=20going=20to=20be.=0A@@=20-1012,16=20+1013,16=20@@=20the=20= callback=20to=20be=20triggered."=0A=20=20=20=20=20=20=20=20= (url-percentage=20(-=20nd=20url-http-end-of-headers)=0A=20=09=09=20=20=20= =20=20=20=20url-http-content-length)=0A=20=20=20=20=20=20=20=20= url-http-content-type=0A-=20=20=20=20=20=20=20(file-size-human-readable=20= (-=20nd=20url-http-end-of-headers))=0A-=20=20=20=20=20=20=20= (file-size-human-readable=20url-http-content-length)=0A+=20=20=20=20=20=20= =20(file-size-human-readable=20(-=20nd=20url-http-end-of-headers)=20'iec=20= "=20")=0A+=20=20=20=20=20=20=20(file-size-human-readable=20= url-http-content-length=20'iec=20"=20")=0A=20=20=20=20=20=20=20=20= (url-percentage=20(-=20nd=20url-http-end-of-headers)=0A=20=09=09=20=20=20= =20=20=20=20url-http-content-length))=0A=20=20=20=20=20= (url-display-percentage=0A=20=20=20=20=20=20"Reading...=20%s=20of=20%s=20= (%d%%)"=0A=20=20=20=20=20=20(url-percentage=20(-=20nd=20= url-http-end-of-headers)=0A=20=09=09=20=20=20=20=20= url-http-content-length)=0A-=20=20=20=20=20(file-size-human-readable=20= (-=20nd=20url-http-end-of-headers))=0A-=20=20=20=20=20= (file-size-human-readable=20url-http-content-length)=0A+=20=20=20=20=20= (file-size-human-readable=20(-=20nd=20url-http-end-of-headers)=20'iec=20= "=20")=0A+=20=20=20=20=20(file-size-human-readable=20= url-http-content-length=20'iec=20"=20")=0A=20=20=20=20=20=20= (url-percentage=20(-=20nd=20url-http-end-of-headers)=0A=20=09=09=20=20=20= =20=20url-http-content-length)))=0A=20=0Adiff=20--git=20= a/test/lisp/files-tests.el=20b/test/lisp/files-tests.el=0Aindex=20= fe2e958f1c..b000c3070d=20100644=0A---=20a/test/lisp/files-tests.el=0A+++=20= b/test/lisp/files-tests.el=0A@@=20-1259,5=20+1259,25=20@@=20renaming=20= only,=20rather=20than=20modified=20in-place."=0A=20=20=20=20=20=20=20= (ignore-errors=20(advice-remove=20#'write-region=20advice))=0A=20=20=20=20= =20=20=20(ignore-errors=20(delete-file=20temp-file-name)))))=0A=20=0A= +(ert-deftest=20files-test-file-size-human-readable=20()=0A+=20=20= (should=20(equal=20(file-size-human-readable=2013)=20"13"))=0A+=20=20= (should=20(equal=20(file-size-human-readable=2013=20'si)=20"13"))=0A+=20=20= (should=20(equal=20(file-size-human-readable=2013=20'iec)=20"13B"))=0A+=20= =20(should=20(equal=20(file-size-human-readable=2010000)=20"9.8k"))=0A+=20= =20(should=20(equal=20(file-size-human-readable=2010000=20'si)=20"10k"))=0A= +=20=20(should=20(equal=20(file-size-human-readable=2010000=20'iec)=20= "9.8KiB"))=0A+=20=20(should=20(equal=20(file-size-human-readable=20= 4294967296=20nil)=20"4G"))=0A+=20=20(should=20(equal=20= (file-size-human-readable=204294967296=20'si)=20"4.3G"))=0A+=20=20= (should=20(equal=20(file-size-human-readable=204294967296=20'iec)=20= "4GiB"))=0A+=20=20(should=20(equal=20(file-size-human-readable=2013=20= nil=20"=20")=20"13"))=0A+=20=20(should=20(equal=20= (file-size-human-readable=2013=20'si=20"=20")=20"13"))=0A+=20=20(should=20= (equal=20(file-size-human-readable=2013=20'iec=20"=20")=20"13=20B"))=0A+=20= =20(should=20(equal=20(file-size-human-readable=2010000=20nil=20"=20")=20= "9.8=20k"))=0A+=20=20(should=20(equal=20(file-size-human-readable=20= 10000=20'si=20"=20")=20"10=20k"))=0A+=20=20(should=20(equal=20= (file-size-human-readable=2010000=20'iec=20"=20")=20"9.8=20KiB"))=0A+=20=20= (should=20(equal=20(file-size-human-readable=204294967296=20nil=20"=20")=20= "4=20G"))=0A+=20=20(should=20(equal=20(file-size-human-readable=20= 4294967296=20'si=20"=20")=20"4.3=20G"))=0A+=20=20(should=20(equal=20= (file-size-human-readable=204294967296=20'iec=20"=20")=20"4=20GiB")))=0A= +=0A=20(provide=20'files-tests)=0A=20;;;=20files-tests.el=20ends=20here=0A= --=20=0A2.20.1=20(Apple=20Git-117)=0A=0A= --Apple-Mail=_2BFCA44F-6612-4B8A-8A1E-098E52547D0D--