unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Daniel Mendler <mail@daniel-mendler.de>, Eli Zaretskii <eliz@gnu.org>
Cc: 52459@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: Tue, 14 Dec 2021 21:40:50 +0300	[thread overview]
Message-ID: <bcc9380b-a371-8119-a726-2a8c2f9c0576@yandex.ru> (raw)
In-Reply-To: <86f4ea53-1f83-eb14-2f24-b50e9de6a80a@daniel-mendler.de>

On 14.12.2021 21:32, Daniel Mendler wrote:
> 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))

This is interesting, because print-escape-control-characters (which I 
mentioned) does not:

ELISP> (let ((print-escape-control-characters t)) (prin1 "\b"))

"\10"
"\b"
ELISP> (let ((print-escape-control-characters t)) (prin1-to-string "\b"))
"\"\\10\""
ELISP> (let ((print-escape-control-characters t)) (format "\b"))
"\b"
ELISP> (let ((print-escape-control-characters t)) (message "\b"))
"\b"

 >> Is that a problem?
 >>
 >> If not, adding a new variable which makes the same distinction seems
 >> consistent with the current design.
 > Exactly. My proposal is consistent with the current design.

...but indeed if the new variable has the same scope as either of the 
existing ones, it seems easy to justify.

Maybe reconcile the scopes of the existing vars, too. 
'print-escape-multibyte' is documented as "This affects only ‘prin1’", 
but it is the other var which makes the distinction.





  reply	other threads:[~2021-12-14 18:40 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-12 20:13 bug#52459: 28.0.90; prin1-to-string does not escape bidi control characters despite print-escape-control-characters=t Daniel Mendler
2021-12-12 20:42 ` Eli Zaretskii
2021-12-12 21:11   ` Daniel Mendler
2021-12-12 21:33     ` Daniel Mendler
2021-12-13 12:22       ` Eli Zaretskii
2021-12-13 13:19         ` Daniel Mendler
2021-12-13 13:30           ` Daniel Mendler
2021-12-13 15:24             ` Eli Zaretskii
2021-12-13 16:32               ` Daniel Mendler
2021-12-13 17:07                 ` Eli Zaretskii
2021-12-13 18:13                   ` Daniel Mendler
2021-12-13 18:28                     ` Eli Zaretskii
2021-12-13 18:35                       ` Daniel Mendler
2021-12-13 18:52                         ` Eli Zaretskii
2021-12-13 18:57                           ` Daniel Mendler
2021-12-13 19:08                             ` Eli Zaretskii
2021-12-13 19:16                               ` Daniel Mendler
2021-12-13 19:38                                 ` Eli Zaretskii
2021-12-14 18:23                                   ` Dmitry Gutov
2021-12-14 18:32                                     ` Daniel Mendler
2021-12-14 18:40                                       ` Dmitry Gutov [this message]
2021-12-14 18:47                                       ` Eli Zaretskii
2021-12-14 18:51                                         ` Daniel Mendler
2021-12-14 19:41                                           ` Dmitry Gutov
2021-12-14 19:22                                       ` Andreas Schwab
2021-12-14 18:39                                     ` Eli Zaretskii
2021-12-14 18:56                                       ` Dmitry Gutov
2021-12-14 19:20                                         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bcc9380b-a371-8119-a726-2a8c2f9c0576@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=52459@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=mail@daniel-mendler.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).