GNU bug report logs - #52459
28.0.90; prin1-to-string does not escape bidi control characters despite print-escape-control-characters=t

Previous Next

Package: emacs;

Reported by: Daniel Mendler <mail <at> daniel-mendler.de>

Date: Sun, 12 Dec 2021 20:14:01 UTC

Severity: normal

Found in version 28.0.90

Full log


View this message in rfc822 format

From: Daniel Mendler <mail <at> daniel-mendler.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 52459 <at> debbugs.gnu.org, dgutov <at> yandex.ru
Subject: bug#52459: 28.0.90; prin1-to-string does not escape bidi control characters despite print-escape-control-characters=t
Date: Tue, 14 Dec 2021 19:51:50 +0100

On 12/14/21 7:47 PM, Eli Zaretskii wrote:
>> Cc: 52459 <at> debbugs.gnu.org
>> From: Daniel Mendler <mail <at> daniel-mendler.de>
>> Date: Tue, 14 Dec 2021 19:32:47 +0100
>>
>> On 12/14/21 7:23 PM, Dmitry Gutov wrote:
>>> I just did a little testing, and it seems 
>>> 'print-escape-control-characters' only affects 'prin1-to-string' and 
>>> 'prin1' but not 'message' or 'format'.
>>
>> No, `print-escape-multibyte` also applies to `format  and `message`. Try
>> the following:
>>
>> (let ((print-escape-multibyte t))
>>   (format "%S" bidi-directional-controls-chars)
>>   (message "%S" bidi-directional-controls-chars))
> 
> Strings are not usually formatted using %S, they are formatted using
> %s.  It would be unreasonable to expect Lisp programs to use %S for
> formatting strings.

I am talking about creating string representations of Elisp values. I
did not exclusively talk about strings. Strings are of course also Elisp
values, but for a debugger UI it is useful to produce string
representations of general Elisp values.




This bug report was last modified 3 years and 183 days ago.

Previous Next


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