From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#44155: Print integers as characters Date: Wed, 4 Nov 2020 17:58:02 +0100 Message-ID: References: <871rhd3peq.fsf@mail.linkov.net> <608FF40B-D8F6-471E-8036-4779D892E987@acm.org> <87imanigpd.fsf@mail.linkov.net> <83ft5qcvl6.fsf@gnu.org> <650DFF04-509F-4B8C-9C53-F38DC10B9F97@acm.org> <83y2jib5c7.fsf@gnu.org> <83lffhb090.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_613662AB-95A0-4061-B77C-20AA19A7CF44" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32551"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 44155@debbugs.gnu.org, schwab@suse.de, juri@linkov.net To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 04 17:59:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1kaM7r-0008LF-TR for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 04 Nov 2020 17:59:12 +0100 Original-Received: from localhost ([::1]:40038 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kaM7q-0001zs-Q9 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 04 Nov 2020 11:59:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54990) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kaM7i-0001y4-8a for bug-gnu-emacs@gnu.org; Wed, 04 Nov 2020 11:59:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38917) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kaM7h-0004Xd-VQ for bug-gnu-emacs@gnu.org; Wed, 04 Nov 2020 11:59:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kaM7h-0007es-S8 for bug-gnu-emacs@gnu.org; Wed, 04 Nov 2020 11:59:01 -0500 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, 04 Nov 2020 16:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44155 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed patch Original-Received: via spool by 44155-submit@debbugs.gnu.org id=B44155.160450909029373 (code B ref 44155); Wed, 04 Nov 2020 16:59:01 +0000 Original-Received: (at 44155) by debbugs.gnu.org; 4 Nov 2020 16:58:10 +0000 Original-Received: from localhost ([127.0.0.1]:50463 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kaM6s-0007dh-Jc for submit@debbugs.gnu.org; Wed, 04 Nov 2020 11:58:10 -0500 Original-Received: from mail79c50.megamailservers.eu ([91.136.10.89]:57854 helo=mail70c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kaM6p-0007dX-Nj for 44155@debbugs.gnu.org; Wed, 04 Nov 2020 11:58:09 -0500 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1604509086; bh=VZ4OQBO7/K5EI+3qQWlsQHXM/4l7d8liPmB8JUhM1RA=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=EbR2tCD97P43BPwtV9zqW2tuzfuv+LGOPGfyb7fDDz11qL8XNsOxT3OD6kmSCpO2m z/xMC7gqPoxkMQVMh8ncJwDyLzf03lXUY2jWhsKAy0S/YX7BaVf0NoDZ8DnvyeIbCe gMyiF4VFLiFgRfvRU74fMyQBwVQVebmbArbsfNXg= Feedback-ID: mattiase@acm.or Original-Received: from [192.168.0.4] (c188-150-171-71.bredband.comhem.se [188.150.171.71]) (authenticated bits=0) by mail70c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 0A4Gw3uQ030897; Wed, 4 Nov 2020 16:58:04 +0000 In-Reply-To: X-Mailer: Apple Mail (2.3445.104.17) X-CTCH-RefID: str=0001.0A782F21.5FA2DD9E.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=H6ulPNQi c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=M51BFTxLslgA:10 a=2WRZgn4w7lo6qwKW3QUA:9 a=CjuIK1q_8ugA:10 a=8vRBGogvbazS6joDgeoA:9 a=B2y7HmGcmWMA:10 X-Origin-Country: SE X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:192678 Archived-At: --Apple-Mail=_613662AB-95A0-4061-B77C-20AA19A7CF44 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii The last patch was incorrect; here is the right one. Apologies for the = confusion. --Apple-Mail=_613662AB-95A0-4061-B77C-20AA19A7CF44 Content-Disposition: attachment; filename=0001-Reduce-integer-output-format-to-print-integers-as-ch.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Reduce-integer-output-format-to-print-integers-as-ch.patch" Content-Transfer-Encoding: quoted-printable =46rom=202a7bd3b8393f182e42d77e929d5e02a137c8e89b=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20= =0ADate:=20Mon,=202=20Nov=202020=2023:37:16=20+0100=0A= Subject:=20[PATCH]=20Reduce=20integer-output-format=20to=20= print-integers-as-characters=0A=0AThe=20variable=20now=20only=20controls=20= whether=20characters=20are=20printed,=20not=0Athe=20radix.=20=20Control=20= chars=20are=20printed=20in=20human-readable=20syntax=0Aonly=20when=20= special=20escapes=20such=20as=20?\n=20are=20available.=20=20Spaces,=0A= formatting=20and=20combining=20chars=20are=20excluded=20(bug#44155).=0A= Done=20in=20collaboration=20with=20Juri=20Linkov.=0A=0A*=20= src/character.c=20(graphic_base_p):=0A*=20src/print.c=20(named_escape):=20= New=20functions.=0A(print_object):=20Change=20semantics=20as=20described=20= above.=0A(syms_of_print):=20Rename=20integer-output-format.=20=20Update=20= doc=20string.=0A*=20doc/lispref/streams.texi=20(Output=20Variables):=0A*=20= etc/NEWS:=0A*=20test/src/print-tests.el=20= (print-integers-as-characters):=0ARename=20and=20update=20according=20to=20= new=20semantics.=20=20The=20test=20now=20passes.=0A---=0A=20= doc/lispref/streams.texi=20|=2018=20+++++++----=0A=20etc/NEWS=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20|=2011=20++++---=0A=20= src/character.c=20=20=20=20=20=20=20=20=20=20|=2021=20+++++++++++++=0A=20= src/character.h=20=20=20=20=20=20=20=20=20=20|=20=201=20+=0A=20= src/print.c=20=20=20=20=20=20=20=20=20=20=20=20=20=20|=2064=20= ++++++++++++++++++++++++++--------------=0A=20test/src/print-tests.el=20=20= |=2039=20+++++++++++++-----------=0A=206=20files=20changed,=20102=20= insertions(+),=2052=20deletions(-)=0A=0Adiff=20--git=20= a/doc/lispref/streams.texi=20b/doc/lispref/streams.texi=0Aindex=20= f171f13779..0534afb67f=20100644=0A---=20a/doc/lispref/streams.texi=0A+++=20= b/doc/lispref/streams.texi=0A@@=20-903,10=20+903,16=20@@=20Output=20= Variables=0A=20you=20can=20use,=20see=20the=20variable's=20documentation=20= string.=0A=20@end=20defvar=0A=20=0A-@defvar=20integer-output-format=0A= -This=20variable=20specifies=20how=20to=20print=20integer=20numbers.=20=20= The=20default=20is=0A-@code{nil},=20meaning=20use=20the=20decimal=20= format.=20=20When=20bound=20to=20@code{t},=0A-print=20integers=20as=20= characters=20when=20an=20integer=20represents=20a=20character=0A= -(@pxref{Basic=20Char=20Syntax}).=20=20When=20bound=20to=20the=20number=20= @code{16},=0A-print=20non-negative=20integers=20in=20the=20hexadecimal=20= format.=0A+@defvar=20print-integers-as-characters=0A+When=20this=20= variable=20is=20non-@code{nil},=20integers=20that=20represent=0A+graphic=20= base=20characters=20will=20be=20printed=20using=20Lisp=20character=20= syntax=0A+(@pxref{Basic=20Char=20Syntax}).=20Other=20numbers=20are=20= printed=20the=20usual=20way.=0A+For=20example,=20the=20list=20@code{(4=20= 65=20-1=2010)}=20would=20be=20printed=20as=0A+@samp{(4=20?A=20-1=20= ?\n)}.=0A+=0A+More=20precisely,=20values=20printed=20in=20character=20= syntax=20are=20those=0A+representing=20characters=20belonging=20to=20the=20= Unicode=20general=20categories=0A+Letter,=20Number,=20Punctuation,=20= Symbol=20and=20Private-use=0A+(@pxref{Character=20Properties}),=20as=20= well=20as=20the=20control=20characters=0A+having=20their=20own=20escape=20= syntax=20such=20as=20newline.=0A=20@end=20defvar=0Adiff=20--git=20= a/etc/NEWS=20b/etc/NEWS=0Aindex=20d15f3ed1ae..9dcdcc3079=20100644=0A---=20= a/etc/NEWS=0A+++=20b/etc/NEWS=0A@@=20-1697,12=20+1697,6=20@@=20ledit.el,=20= lmenu.el,=20lucid.el=20and=20old-whitespace.el.=0A=20=0C=0A=20*=20Lisp=20= Changes=20in=20Emacs=2028.1=0A=20=0A-**=20New=20variable=20= 'integer-output-format'=20determines=20how=20to=20print=20integer=20= values.=0A-When=20this=20variable=20is=20bound=20to=20the=20value=20't',=20= integers=20are=20printed=20by=0A-printing=20functions=20as=20characters=20= when=20an=20integer=20represents=20a=20character.=0A-When=20bound=20to=20= the=20number=2016,=20non-negative=20integers=20are=20printed=20in=20the=0A= -hexadecimal=20format.=0A-=0A=20+++=0A=20**=20= 'define-globalized-minor-mode'=20now=20takes=20a=20':predicate'=20= parameter.=0A=20This=20can=20be=20used=20to=20control=20which=20major=20= modes=20the=20minor=20mode=20should=20be=0A@@=20-1895,6=20+1889,11=20@@=20= file=20can=20affect=20code=20in=20another.=20=20For=20details,=20see=20= the=20manual=20section=0A=20'replace-regexp-in-string',=20'catch',=20= 'throw',=20'error',=20'signal'=0A=20and=20'play-sound-file'.=0A=20=0A= ++++=0A+**=20New=20variable=20'print-integers-as-characters'=20modifies=20= integer=20printing.=0A+If=20this=20variable=20is=20non-nil,=20character=20= syntax=20is=20used=20for=20printing=0A+numbers=20when=20this=20makes=20= sense,=20such=20as=20'?A'=20for=2065.=0A+=0A=20=0C=0A=20*=20Changes=20in=20= Emacs=2028.1=20on=20Non-Free=20Operating=20Systems=0A=20=0Adiff=20--git=20= a/src/character.c=20b/src/character.c=0Aindex=205860f6a0c8..00b73293a3=20= 100644=0A---=20a/src/character.c=0A+++=20b/src/character.c=0A@@=20-982,6=20= +982,27=20@@=20printablep=20(int=20c)=0A=20=09=20=20=20=20||=20gen_cat=20= =3D=3D=20UNICODE_CATEGORY_Cn));=20/*=20unassigned=20*/=0A=20}=0A=20=0A= +/*=20Return=20true=20if=20C=20is=20graphic=20character=20that=20can=20= be=20printed=20independently.=20=20*/=0A+bool=0A+graphic_base_p=20(int=20= c)=0A+{=0A+=20=20Lisp_Object=20category=20=3D=20CHAR_TABLE_REF=20= (Vunicode_category_table,=20c);=0A+=20=20if=20(!=20FIXNUMP=20(category))=0A= +=20=20=20=20return=20false;=0A+=20=20EMACS_INT=20gen_cat=20=3D=20= XFIXNUM=20(category);=0A+=0A+=20=20return=20(!(gen_cat=20=3D=3D=20= UNICODE_CATEGORY_Mn=20=20=20=20=20=20=20/*=20mark,=20nonspacing=20*/=0A+=20= =20=20=20=20=20=20=20=20=20=20=20||=20gen_cat=20=3D=3D=20= UNICODE_CATEGORY_Mc=20=20=20=20/*=20mark,=20combining=20*/=0A+=20=20=20=20= =20=20=20=20=20=20=20=20||=20gen_cat=20=3D=3D=20UNICODE_CATEGORY_Me=20=20= =20=20/*=20mark,=20enclosing=20*/=0A+=20=20=20=20=20=20=20=20=20=20=20=20= ||=20gen_cat=20=3D=3D=20UNICODE_CATEGORY_Zs=20=20=20=20/*=20separator,=20= space=20*/=0A+=20=20=20=20=20=20=20=20=20=20=20=20||=20gen_cat=20=3D=3D=20= UNICODE_CATEGORY_Zl=20=20=20=20/*=20separator,=20line=20*/=0A+=20=20=20=20= =20=20=20=20=20=20=20=20||=20gen_cat=20=3D=3D=20UNICODE_CATEGORY_Zp=20=20= =20=20/*=20separator,=20paragraph=20*/=0A+=20=20=20=20=20=20=20=20=20=20=20= =20||=20gen_cat=20=3D=3D=20UNICODE_CATEGORY_Cc=20=20=20=20/*=20other,=20= control=20*/=0A+=20=20=20=20=20=20=20=20=20=20=20=20||=20gen_cat=20=3D=3D=20= UNICODE_CATEGORY_Cs=20=20=20=20/*=20other,=20surrogate=20*/=0A+=20=20=20=20= =20=20=20=20=20=20=20=20||=20gen_cat=20=3D=3D=20UNICODE_CATEGORY_Cf=20=20= =20=20/*=20other,=20format=20*/=0A+=20=20=20=20=20=20=20=20=20=20=20=20= ||=20gen_cat=20=3D=3D=20UNICODE_CATEGORY_Cn));=20/*=20other,=20= unassigned=20*/=0A+}=0A+=0A=20/*=20Return=20true=20if=20C=20is=20a=20= horizontal=20whitespace=20character,=20as=20defined=0A=20=20=20=20by=20= https://www.unicode.org/reports/tr18/tr18-19.html#blank.=20=20*/=0A=20= bool=0Adiff=20--git=20a/src/character.h=20b/src/character.h=0Aindex=20= af5023f77c..cbf43097ae=20100644=0A---=20a/src/character.h=0A+++=20= b/src/character.h=0A@@=20-583,6=20+583,7=20@@=20char_surrogate_p=20(int=20= c)=0A=20extern=20bool=20graphicp=20(int);=0A=20extern=20bool=20= printablep=20(int);=0A=20extern=20bool=20blankp=20(int);=0A+extern=20= bool=20graphic_base_p=20(int);=0A=20=0A=20/*=20Look=20up=20the=20element=20= in=20char=20table=20OBJ=20at=20index=20CH,=20and=20return=20it=20as=0A=20= =20=20=20an=20integer.=20=20If=20the=20element=20is=20not=20a=20= character,=20return=20CH=20itself.=20=20*/=0Adiff=20--git=20= a/src/print.c=20b/src/print.c=0Aindex=20fa65a3cb26..f2e2dd131d=20100644=0A= ---=20a/src/print.c=0A+++=20b/src/print.c=0A@@=20-1848,6=20+1848,24=20@@=20= print_vectorlike=20(Lisp_Object=20obj,=20Lisp_Object=20printcharfun,=20= bool=20escapeflag,=0A=20=20=20return=20true;=0A=20}=0A=20=0A+static=20= char=0A+named_escape=20(int=20i)=0A+{=0A+=20=20switch=20(i)=0A+=20=20=20=20= {=0A+=20=20=20=20case=20'\b':=20return=20'b';=0A+=20=20=20=20case=20= '\t':=20return=20't';=0A+=20=20=20=20case=20'\n':=20return=20'n';=0A+=20=20= =20=20case=20'\f':=20return=20'f';=0A+=20=20=20=20case=20'\r':=20return=20= 'r';=0A+=20=20=20=20case=20'=20':=20=20return=20's';=0A+=20=20=20=20=20=20= /*=20\a,=20\v,=20\e=20and=20\d=20are=20excluded=20from=20printing=20as=20= escapes=20since=0A+=20=20=20=20=20=20=20=20=20they=20are=20somewhat=20= rare=20as=20characters=20and=20more=20likely=20to=20be=0A+=20=20=20=20=20= =20=20=20=20plain=20integers.=20*/=0A+=20=20=20=20}=0A+=20=20return=200;=0A= +}=0A+=0A=20static=20void=0A=20print_object=20(Lisp_Object=20obj,=20= Lisp_Object=20printcharfun,=20bool=20escapeflag)=0A=20{=0A@@=20-1908,29=20= +1926,30=20@@=20print_object=20(Lisp_Object=20obj,=20Lisp_Object=20= printcharfun,=20bool=20escapeflag)=0A=20=20=20=20=20{=0A=20=20=20=20=20= case_Lisp_Int:=0A=20=20=20=20=20=20=20{=0A-=09int=20c;=0A-=09intmax_t=20= i;=0A+=20=20=20=20=20=20=20=20EMACS_INT=20i=20=3D=20XFIXNUM=20(obj);=0A+=20= =20=20=20=20=20=20=20char=20escaped_name;=0A=20=0A-=09if=20(EQ=20= (Vinteger_output_format,=20Qt)=20&&=20CHARACTERP=20(obj)=0A-=09=20=20=20=20= &&=20(c=20=3D=20XFIXNUM=20(obj)))=0A+=09if=20= (print_integers_as_characters=20&&=20i=20>=3D=200=20&&=20i=20<=3D=20= MAX_UNICODE_CHAR=0A+=20=20=20=20=20=20=20=20=20=20=20=20&&=20= ((escaped_name=20=3D=20named_escape=20(i))=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20||=20graphic_base_p=20(i)))=0A=20=09=20=20{=0A=20=09= =20=20=20=20printchar=20('?',=20printcharfun);=0A-=09=20=20=20=20if=20= (escapeflag=0A-=09=09&&=20(c=20=3D=3D=20';'=20||=20c=20=3D=3D=20'('=20||=20= c=20=3D=3D=20')'=20||=20c=20=3D=3D=20'{'=20||=20c=20=3D=3D=20'}'=0A-=09=09= =20=20=20=20||=20c=20=3D=3D=20'['=20||=20c=20=3D=3D=20']'=20||=20c=20=3D=3D= =20'\"'=20||=20c=20=3D=3D=20'\''=20||=20c=20=3D=3D=20'\\'))=0A+=20=20=20=20= =20=20=20=20=20=20=20=20if=20(escaped_name)=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20{=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= printchar=20('\\',=20printcharfun);=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20i=20=3D=20escaped_name;=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20}=0A+=20=20=20=20=20=20=20=20=20=20=20=20else=20if=20(escapeflag=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20&&=20(i=20= =3D=3D=20';'=20||=20i=20=3D=3D=20'\"'=20||=20i=20=3D=3D=20'\''=20||=20i=20= =3D=3D=20'\\'=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||=20i=20=3D=3D=20'('=20||=20i=20=3D=3D=20')'=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= i=20=3D=3D=20'{'=20||=20i=20=3D=3D=20'}'=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||=20i=20=3D=3D=20'['=20||=20= i=20=3D=3D=20']'))=0A=20=09=20=20=20=20=20=20printchar=20('\\',=20= printcharfun);=0A-=09=20=20=20=20printchar=20(c,=20printcharfun);=0A-=09=20= =20}=0A-=09else=20if=20(INTEGERP=20(Vinteger_output_format)=0A-=09=09=20= &&=20integer_to_intmax=20(Vinteger_output_format,=20&i)=0A-=09=09=20&&=20= i=20=3D=3D=2016=20&&=20!NILP=20(Fnatnump=20(obj)))=0A-=09=20=20{=0A-=09=20= =20=20=20int=20len=20=3D=20sprintf=20(buf,=20"#x%"pI"x",=20(EMACS_UINT)=20= XFIXNUM=20(obj));=0A-=09=20=20=20=20strout=20(buf,=20len,=20len,=20= printcharfun);=0A+=09=20=20=20=20printchar=20(i,=20printcharfun);=0A=20=09= =20=20}=0A=20=09else=0A=20=09=20=20{=0A-=09=20=20=20=20int=20len=20=3D=20= sprintf=20(buf,=20"%"pI"d",=20XFIXNUM=20(obj));=0A+=09=20=20=20=20int=20= len=20=3D=20sprintf=20(buf,=20"%"pI"d",=20i);=0A=20=09=20=20=20=20strout=20= (buf,=20len,=20len,=20printcharfun);=0A=20=09=20=20}=0A=20=20=20=20=20=20= =20}=0A@@=20-2270,12=20+2289,13=20@@=20syms_of_print=20(void)=0A=20that=20= represents=20the=20number=20without=20losing=20information.=20=20*/);=0A=20= =20=20Vfloat_output_format=20=3D=20Qnil;=0A=20=0A-=20=20DEFVAR_LISP=20= ("integer-output-format",=20Vinteger_output_format,=0A-=09=20=20=20=20=20= =20=20doc:=20/*=20The=20format=20used=20to=20print=20integers.=0A-When=20= t,=20print=20characters=20from=20integers=20that=20represent=20a=20= character.=0A-When=20a=20number=2016,=20print=20non-negative=20integers=20= in=20the=20hexadecimal=20format.=0A-Otherwise,=20by=20default=20print=20= integers=20in=20the=20decimal=20format.=20=20*/);=0A-=20=20= Vinteger_output_format=20=3D=20Qnil;=0A+=20=20DEFVAR_BOOL=20= ("print-integers-as-characters",=20print_integers_as_characters,=0A+=09=20= =20=20=20=20=20=20doc:=20/*=20Non-nil=20means=20integers=20are=20printed=20= using=20characters=20syntax.=0A+Only=20independent=20graphic=20= characters,=20and=20control=20characters=20with=20named=0A+escape=20= sequences=20such=20as=20newline,=20are=20printed=20this=20way.=20=20= Other=0A+integers,=20including=20those=20corresponding=20to=20raw=20= bytes,=20are=20printed=0A+affected.=20=20*/);=0A+=20=20= print_integers_as_characters=20=3D=20Qnil;=0A=20=0A=20=20=20DEFVAR_LISP=20= ("print-length",=20Vprint_length,=0A=20=09=20=20=20=20=20=20=20doc:=20/*=20= Maximum=20length=20of=20list=20to=20print=20before=20abbreviating.=0A= diff=20--git=20a/test/src/print-tests.el=20b/test/src/print-tests.el=0A= index=207b026b6b21..202555adb3=20100644=0A---=20= a/test/src/print-tests.el=0A+++=20b/test/src/print-tests.el=0A@@=20= -383,25=20+383,28=20@@=20print-hash-table-test=0A=20=20=20=20=20=20=20= (let=20((print-length=201))=0A=20=20=20=20=20=20=20=20=20(format=20"%S"=20= h))))))=0A=20=0A-(print-tests--deftest=20print-integer-output-format=20= ()=0A+(print-tests--deftest=20print-integers-as-characters=20()=0A=20=20=20= ;;=20Bug#44155.=0A-=20=20(let=20((integer-output-format=20t)=0A-=20=20=20= =20=20=20=20=20(syms=20(list=20??=20?\;=20?\(=20?\)=20?\{=20?\}=20?\[=20= ?\]=20?\"=20?\'=20?\\=20?=C3=81)))=0A-=20=20=20=20(should=20(equal=20= (read=20(print-tests--prin1-to-string=20syms))=20syms))=0A-=20=20=20=20= (should=20(equal=20(print-tests--prin1-to-string=20syms)=0A-=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(concat=20"("=20(mapconcat=20= #'prin1-char=20syms=20"=20")=20")"))))=0A-=20=20(let=20= ((integer-output-format=20t)=0A-=20=20=20=20=20=20=20=20(syms=20(list=20= -1=200=201=20?\120=204194175=204194176=20(max-char)=20(1+=20= (max-char)))))=0A-=20=20=20=20(should=20(equal=20(read=20= (print-tests--prin1-to-string=20syms))=20syms)))=0A-=20=20(let=20= ((integer-output-format=2016)=0A-=20=20=20=20=20=20=20=20(syms=20(list=20= -1=200=201=20most-positive-fixnum=20(1+=20most-positive-fixnum))))=0A-=20= =20=20=20(should=20(equal=20(read=20(print-tests--prin1-to-string=20= syms))=20syms))=0A-=20=20=20=20(should=20(equal=20= (print-tests--prin1-to-string=20syms)=0A-=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(concat=20"("=20(mapconcat=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= (lambda=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=20=20=20(if=20(and=20(>=3D=20i=200)=20= (<=3D=20i=20most-positive-fixnum))=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(format=20"#x%x"=20i)=20(format=20"%d"=20i)))=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= syms=20"=20")=20")")))))=0A+=20=20(let*=20((print-integers-as-characters=20= t)=0A+=20=20=20=20=20=20=20=20=20(chars=20'(??=20?\;=20?\(=20?\)=20?\{=20= ?\}=20?\[=20?\]=20?\"=20?\'=20?\\=20?f=20?~=20?=C3=81=2032=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20?\n=20?\r=20?\t=20?\b=20?\f=20= ?\a=20?\v=20?\e=20?\d))=0A+=20=20=20=20=20=20=20=20=20(nums=20'(-1=20-65=20= 0=201=2031=20#x80=20#x9f=20#x110000=20#x3fff80=20#x3fffff))=0A+=20=20=20=20= =20=20=20=20=20(nonprints=20'(#xd800=20#xdfff=20#x030a=20#xffff=20#x2002=20= #x200c))=0A+=20=20=20=20=20=20=20=20=20(printed-chars=20= (print-tests--prin1-to-string=20chars))=0A+=20=20=20=20=20=20=20=20=20= (printed-nums=20(print-tests--prin1-to-string=20nums))=0A+=20=20=20=20=20= =20=20=20=20(printed-nonprints=20(print-tests--prin1-to-string=20= nonprints)))=0A+=20=20=20=20(should=20(equal=20(read=20printed-chars)=20= chars))=0A+=20=20=20=20(should=20(equal=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20printed-chars=0A+=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?\\\\"=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20"=20?f=20?~=20?=C3=81=20?\\s=20?\\n=20?\\r=20?\\t=20= ?\\b=20?\\f=207=2011=2027=20127)")))=0A+=20=20=20=20(should=20(equal=20= (read=20printed-nums)=20nums))=0A+=20=20=20=20(should=20(equal=20= printed-nums=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= "(-1=20-65=200=201=2031=20128=20159=201114112=204194176=204194303)"))=0A= +=20=20=20=20(should=20(equal=20(read=20printed-nonprints)=20nonprints))=0A= +=20=20=20=20(should=20(equal=20printed-nonprints=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20"(55296=2057343=20778=2065535=208194=20= 8204)"))))=0A=20=0A=20(provide=20'print-tests)=0A=20;;;=20print-tests.el=20= ends=20here=0A--=20=0A2.21.1=20(Apple=20Git-122.3)=0A=0A= --Apple-Mail=_613662AB-95A0-4061-B77C-20AA19A7CF44--