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
Subject: bug#52459: 28.0.90; prin1-to-string does not escape bidi control characters despite print-escape-control-characters=t
Date: Mon, 13 Dec 2021 14:30:13 +0100
In other words, there is a need for a functionality which makes it
possible to turn a string into a string literal in a form which could be
used in source code for example.

If you look at the definition of bidi-directional-controls-chars in
simple.el, the bidi characters are escaped there. Why is this? Why did
you write this definition in this form and not with unescaped bidi
characters?

(defvar bidi-directional-controls-chars "\x202a-\x202e\x2066-\x2069"
  "Character set that matches bidirectional formatting control characters.")

If I set `print-escape-control-characters` or some hypothetical
`print-escape-unicode-control-characters` to t, I expect a string
literal of this form. The current behavior of Emacs is counter intuitive
since it does not escape all control characters but singles out only the
ASCII control characters. This behavior does not seem correct given full
Emacs support in Emacs.

Therefore my proposal to add two variables
`print-escape-ascii-control-characters` and
`print-escape-unicode-control-characters`.







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

Previous Next


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