GNU bug report logs - #44155
Print integers as characters

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Thu, 22 Oct 2020 21:12:01 UTC

Severity: normal

Tags: fixed, patch

Done: Mattias Engdegård <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Mattias Engdegård <mattiase <at> acm.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 44155 <at> debbugs.gnu.org, Andreas Schwab <schwab <at> suse.de>, Eli Zaretskii <eliz <at> gnu.org>
Subject: bug#44155: Print integers as characters
Date: Tue, 3 Nov 2020 00:03:31 +0100
[Message part 1 (text/plain, inline)]
2 nov. 2020 kl. 22.36 skrev Juri Linkov <juri <at> linkov.net>:
> 
>> Thus we would have 10 -> ?\n, 13 -> ?\r, 127 -> ?\d, 65 -> ?A,
>> 255 -> ?ÿ, but 31 -> 31, 129 -> 129, 4194303 -> 4194303.
> 
> Hopefully, printing some characters as numbers will fix
> the currently broken test.

It does! Here is a proposed patch. We could add a separate radix control later if you like.

One detail that I'm undecided about is whether to remove the more obscure control escapes \f, \a, \v, \e and \d, on the grounds that they are less likely to be used as actual characters and that users may prefer to see them as numbers instead. C, and most languages inheriting them from C, lack \e or \d; \f and \a are rare today, and \v is an anachronism.

> PS: I notices inconsistency in these names: "integer" in print-integer-radix
> is singular, but "integers" in print-integers-as-characters is plural.

Actually, 'integer' in 'integer radix' plays the part of adjective!

[0001-Reduce-integer-output-format-to-print-integers-as-ch.patch (application/octet-stream, attachment)]

This bug report was last modified 4 years and 258 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.