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: Sun, 1 Nov 2020 13:03:52 +0100 Message-ID: References: <87mu0e0ykq.fsf_-_@mail.linkov.net> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5192"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 44155@debbugs.gnu.org To: Juri Linkov , Eli Zaretskii , Andreas Schwab Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 01 13:06:13 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 1kZC7g-0001Fu-Q5 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 01 Nov 2020 13:06:13 +0100 Original-Received: from localhost ([::1]:50700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kZC7f-0000z0-Rj for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 01 Nov 2020 07:06:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47078) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kZC5c-0000QW-7U for bug-gnu-emacs@gnu.org; Sun, 01 Nov 2020 07:04:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52502) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kZC5b-0005qw-5M for bug-gnu-emacs@gnu.org; Sun, 01 Nov 2020 07:04:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kZC5b-0004Uh-1g for bug-gnu-emacs@gnu.org; Sun, 01 Nov 2020 07:04:03 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <87mu0e0ykq.fsf_-_@mail.linkov.net> Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 Nov 2020 12:04:03 +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.160423224217265 (code B ref 44155); Sun, 01 Nov 2020 12:04:03 +0000 Original-Received: (at 44155) by debbugs.gnu.org; 1 Nov 2020 12:04:02 +0000 Original-Received: from localhost ([127.0.0.1]:35813 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZC5Z-0004UD-NN for submit@debbugs.gnu.org; Sun, 01 Nov 2020 07:04:02 -0500 Original-Received: from mail80c50.megamailservers.eu ([91.136.10.90]:38506 helo=mail70c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kZC5W-0004Tx-4w; Sun, 01 Nov 2020 07:04:00 -0500 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1604232235; bh=+Opd/8pOK+FOQhy8IQQzl3IAo8K/kvr1NIFYqHysDko=; h=From:Date:Subject:Cc:To:From; b=j2dwAd+KzSzQaGX9llcJAcqHrr3fjTJ9/vDGQkLP8plthNXRjyBYoijqHV1y5juE3 mILB05iTDBEw9eUNimLyOC0vxo+f/GVARLwRLIsDIvnkdBrRKD6JYYayFWXZbgRFpG L0O8GctUBbnE+b36tk9EQK4CJn+/NnDII7DKjD9w= 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 0A1C3qgq002471; Sun, 1 Nov 2020 12:03:54 +0000 X-Mailer: Apple Mail (2.3445.104.17) X-CTCH-RefID: str=0001.0A782F23.5F9EA42B.005E, 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=OKBZIhSB c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=IkcTkHD0fZMA:10 a=M51BFTxLslgA:10 a=GaJM6Y1Rso56rlZnNj0A:9 a=QEXdDO2ut3YA: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:192348 Archived-At: reopen 44155 stop I don't mind the basic idea, but I'm reopening the bug since it looks = like there is some unfinished business. Hope you don't mind. > When t, print characters from integers that represent a character. In what way does 't' suggest a character? Wouldn't something like = 'character' be more suggestive? The variable isn't named 'print-integers-as-chars'. > When a number 16, print non-negative integers in the hexadecimal = format. Doesn't work for bignums: (let ((integer-output-format 16)) (print 394583945873948753948539845)) 394583945873948753948539845 This must be a bug since there is no reason why bignums should be = treated specially. In general we try hard not to. Since there is a read syntax for binary and octal numbers as well, why = not permit 2 and 8? (And why not print negative numbers in the selected radix?) And C0/C1 controls aren't printed well: (let ((integer-output-format t)) (print 10) (print 127)) ? ?=7F^? I strongly suggest that the controls that have special escapes, like \n, = use them. What to use for the rest depends on the user's preference = really -- for example, 31 might be printed as 31, ?\037, #o37 or #x1f. Whether to print 32 as ?=E2=80=B9SPACE=E2=80=BA or ?\s is a matter of = taste. For that matter, the variable name should perhaps start with 'print-' = like other variables that control printing. Maybe we should separate the = default radix and print integers as characters? Thus, we'd have: print-integer-radix -- 2, 8, 16, 10 or nil (which means 10) print-integers-as-characters -- nil or t