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: Fri, 17 May 2019 13:01:19 +0200 Message-ID: <4C9BDFF7-BCE4-421C-84AE-20E243894495@acm.org> References: <28D42987-D855-4213-9111-DB01E0753D9A@acm.org> <83zhnlbp4l.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_FCE30540-E666-4D25-8B49-A3052322703A" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="181187"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 35756@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 17 13:18:38 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 1hRasm-000l0B-95 for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 May 2019 13:18:36 +0200 Original-Received: from localhost ([127.0.0.1]:46785 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRasl-0007pp-7V for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 May 2019 07:18:35 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:56563) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRafd-0004ky-52 for bug-gnu-emacs@gnu.org; Fri, 17 May 2019 07:05:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hRack-0002Xt-4C for bug-gnu-emacs@gnu.org; Fri, 17 May 2019 07:02:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43921) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hRacj-0002Xp-VM for bug-gnu-emacs@gnu.org; Fri, 17 May 2019 07:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hRacj-0004tx-Qt for bug-gnu-emacs@gnu.org; Fri, 17 May 2019 07:02:01 -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: Fri, 17 May 2019 11:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35756 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 35756-submit@debbugs.gnu.org id=B35756.155809088818798 (code B ref 35756); Fri, 17 May 2019 11:02:01 +0000 Original-Received: (at 35756) by debbugs.gnu.org; 17 May 2019 11:01:28 +0000 Original-Received: from localhost ([127.0.0.1]:57465 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRacC-0004t8-Cb for submit@debbugs.gnu.org; Fri, 17 May 2019 07:01:28 -0400 Original-Received: from mail200c50.megamailservers.eu ([91.136.10.210]:43438 helo=mail193c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRac9-0004sy-Gl for 35756@debbugs.gnu.org; Fri, 17 May 2019 07:01:26 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1558090883; bh=nIJlWjYyiXi5YP2yAQ2lX2dg/Og0hSht1ytuO/td5ys=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=gz/37APl7xwYf521iVTI1eI44sqTYoR7m14akPag2Z7eWVw9zfqZn+SsU64VBk8VN /Nryr9WO9MtSYnq8Kx9OaXjTfUs3dDJqy+mmXExPxKqz3m2Ve2WuruLdVLIzM6nuWE mJWMhLkJd8YnlCVc69h6npMA2mwc/heWeDq+DxUI= 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 mail193c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x4HB1JF6010885; Fri, 17 May 2019 11:01:22 +0000 In-Reply-To: <83zhnlbp4l.fsf@gnu.org> X-Mailer: Apple Mail (2.3445.104.8) X-CTCH-RefID: str=0001.0A0B0204.5CDE9483.0009, 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=PM8hB8iC c=1 sm=1 tr=0 a=M+GU/qJco4WXjv8D6jB2IA==:117 a=M+GU/qJco4WXjv8D6jB2IA==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=mDV3o1hIAAAA:8 a=4uyE4olDKIBf4wq5keYA:9 a=CjuIK1q_8ugA:10 a=FL5RwxRrSzOq-IwuSK4A:9 a=B2y7HmGcmWMA:10 a=_FVE-zBwftR9WsbkzFJk:22 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:159440 Archived-At: --Apple-Mail=_FCE30540-E666-4D25-8B49-A3052322703A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii 17 maj 2019 kl. 07.56 skrev Eli Zaretskii : >=20 > This uses the passive tense too much. The "if nil or omitted, the > empty string is used" part could be worded more clearly as "it > defaults to the empty string". The "It is recommended" part is better > worded as "We recommend". Thank you, fixed. >> +Optional third argument SPACE is a string put between the number and = unit. >> +If nil or omitted, the empty string is used. >=20 > Same here. Fixed. I also added the optional argument UNIT to settle that problem. New = patch attached. --Apple-Mail=_FCE30540-E666-4D25-8B49-A3052322703A Content-Disposition: attachment; filename=0001-Optional-space-and-unit-in-file-size-human-readable-.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Optional-space-and-unit-in-file-size-human-readable-.patch" Content-Transfer-Encoding: quoted-printable =46rom=20403ce6c70dbacf3a99785b730e026fca67ce9a4e=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=20and=20unit=20in=20= `file-size-human-readable'=0A=20(bug#35756)=0A=0ATo=20improve=20= readability=20of=20strings=20produced=20by=0A`file-size-human-readable',=20= add=20two=20optional=20arguments:=0A=0A-=20SPACE,=20to=20provide=20a=20= string=20(typically=20a=20space=20or=20non-breaking=20space)=0Ato=20put=20= between=20the=20number=20and=20unit.=20=20For=20compatibility,=20the=20= default=20is=0Aan=20empty=20string.=0A=0A-=20UNIT,=20a=20string=20to=20= use=20as=20unit.=20=20For=20compatibility,=20the=20default=20is=0A"B"=20= in=20`iec'=20mode=20and=20the=20empty=20string=20otherwise.=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=20and=20UNIT=20= arguments=20and=20handle=20small=20numbers=20correctly.=0A= (files--ask-user-about-large-file,=20warn-maybe-out-of-memory):=0AUse=20= the=20new=20argument.=0A*=20test/lisp/files-tests.el=20= (files-test-file-size-human-readable):=20New=20test.=0A*=20= lisp/url/url-http.el=20(url-http-simple-after-change-function)=0A= (url-http-content-length-after-change-function):=20Use=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= 9=20++++++++=0A=20lisp/files.el=20=20=20=20=20=20=20=20=20=20=20=20|=20= 49=20+++++++++++++++++++++++++---------------=0A=20lisp/url/url-http.el=20= =20=20=20=20|=2011=20+++++----=0A=20test/lisp/files-tests.el=20|=2023=20= +++++++++++++++++++=0A=204=20files=20changed,=2069=20insertions(+),=2023=20= deletions(-)=0A=0Adiff=20--git=20a/etc/NEWS=20b/etc/NEWS=0Aindex=20= 8c059157ba..215d652a64=20100644=0A---=20a/etc/NEWS=0A+++=20b/etc/NEWS=0A= @@=20-2005,6=20+2005,15=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=20more=20optional=20arguments.=0A= +The=20new=20third=20argument=20is=20a=20string=20put=20between=20the=20= number=20and=20unit;=20it=0A+defaults=20to=20the=20empty=20string.=20=20= The=20new=20fourth=20argument=20is=20a=20string=0A+representing=20the=20= unit=20to=20use;=20it=20defaults=20to=20"B"=20when=20the=20second=0A= +argument=20is=20'iec'=20and=20the=20empty=20string=20otherwise.=20=20We=20= recomment=20a=0A+space=20or=20non-breaking=20space=20as=20third=20= argument,=20and=20"B"=20as=20fourth=0A+argument,=20circumstances=20= allowing.=0A+=0A=20=0C=0A=20*=20Changes=20in=20Emacs=2027.1=20on=20= Non-Free=20Operating=20Systems=0A=20=0Adiff=20--git=20a/lisp/files.el=20= b/lisp/files.el=0Aindex=208fa7f16de0..e84775c6ac=20100644=0A---=20= a/lisp/files.el=0A+++=20b/lisp/files.el=0A@@=20-1358,7=20+1358,7=20@@=20= it=20means=20chase=20no=20more=20than=20that=20many=20links=20and=20then=20= stop."=0A=20=0A=20;;=20A=20handy=20function=20to=20display=20file=20= sizes=20in=20human-readable=20form.=0A=20;;=20See=20= http://en.wikipedia.org/wiki/Kibibyte=20for=20the=20reference.=0A-(defun=20= file-size-human-readable=20(file-size=20&optional=20flavor)=0A+(defun=20= file-size-human-readable=20(file-size=20&optional=20flavor=20space=20= unit)=0A=20=20=20"Produce=20a=20string=20showing=20FILE-SIZE=20in=20= human-readable=20form.=0A=20=0A=20Optional=20second=20argument=20FLAVOR=20= controls=20the=20units=20and=20the=20display=20format:=0A@@=20-1368,24=20= +1368,36=20@@=20Optional=20second=20argument=20FLAVOR=20controls=20the=20= units=20and=20the=20display=20format:=0A=20=20If=20FLAVOR=20is=20`si',=20= each=20kilobyte=20is=201000=20bytes=20and=20the=20produced=20suffixes=0A=20= =20=20=20=20are=20\"k\",=20\"M\",=20\"G\",=20\"T\",=20etc.=0A=20=20If=20= FLAVOR=20is=20`iec',=20each=20kilobyte=20is=201024=20bytes=20and=20the=20= produced=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=20argument=20SPACE=20is=20a=20= string=20put=20between=20the=20number=20and=20unit.=0A+It=20defaults=20= to=20the=20empty=20string.=20=20We=20recommend=20a=20single=20space=20or=0A= +non-breaking=20space,=20unless=20other=20constraints=20prohibit=20a=20= space=20in=20that=0A+position.=0A+=0A+Optional=20fourth=20argument=20= UNIT=20is=20the=20unit=20to=20use.=20=20It=20defaults=20to=20\"B\"=0A= +when=20FLAVOR=20is=20`iec'=20and=20the=20empty=20string=20otherwise.=20=20= We=20recommend=20\"B\"=0A+in=20all=20cases,=20since=20that=20is=20the=20= standard=20symbol=20for=20byte."=0A=20=20=20(let=20((power=20(if=20(or=20= (null=20flavor)=20(eq=20flavor=20'iec))=0A=20=09=09=20=20=201024.0=0A=20=09= =09=201000.0))=0A-=09(post-fixes=0A-=09=20;;=20none,=20kilo,=20mega,=20= giga,=20tera,=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=20file-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=20= post-fixes=20(cdr=20post-fixes)))=0A-=20=20=20=20(format=20(if=20(>=20= (mod=20file-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(let*=20((prefix=20(car=20prefixes))=0A+=20=20= =20=20=20=20=20=20=20=20=20(prefixed-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=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=20=20=20=20=20=20=20=20=20(if=20(string=3D=20= prefix=20"k")=20"K"=20prefix)=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(if=20(string-empty-p=20= prefix)=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=20=20=20=20=20=20=20=20=20(or=20unit=20"B"))=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= (concat=20prefix=20unit))))=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=20prefixed-unit)=20= ""=20(or=20space=20""))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= prefixed-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= +2066,7=20@@=20think=20it=20does,=20because=20\"free\"=20is=20pretty=20= hard=20to=20define=20in=20practice."=0A=20(defun=20= files--ask-user-about-large-file=20(size=20op-type=20filename=20= offer-raw)=0A=20=20=20(let=20((prompt=20(format=20"File=20%s=20is=20= large=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")=20op-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+2118,10=20= @@=20returns=20nil=20or=20exits=20non-locally."=0A=20exceeds=20the=20= %S%%=20of=20currently=20available=20free=20memory=20(%s).=0A=20If=20that=20= fails,=20try=20to=20open=20it=20with=20`find-file-literally'=0A=20\(but=20= note=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..ebdfc12d5d=20100644=0A---=20a/test/lisp/files-tests.el=0A+++=20= b/test/lisp/files-tests.el=0A@@=20-1259,5=20+1259,28=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+=20= =20(should=20(equal=20(file-size-human-readable=2010000=20nil=20"=20"=20= "B")=20"9.8=20kB"))=0A+=20=20(should=20(equal=20= (file-size-human-readable=2010000=20'si=20"=20"=20"B")=20"10=20kB"))=0A+=20= =20(should=20(equal=20(file-size-human-readable=2010000=20'iec=20"=20"=20= "bit")=20"9.8=20Kibit")))=0A+=0A=20(provide=20'files-tests)=0A=20;;;=20= files-tests.el=20ends=20here=0A--=20=0A2.20.1=20(Apple=20Git-117)=0A=0A= --Apple-Mail=_FCE30540-E666-4D25-8B49-A3052322703A--