From: Daniel Mendler <mail@daniel-mendler.de>
To: 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: Mon, 13 Dec 2021 19:13:32 +0100 [thread overview]
Message-ID: <2511c498-1e36-07b2-b9b8-5849902cd416@daniel-mendler.de> (raw)
In-Reply-To: <83wnk8l9ha.fsf@gnu.org>
> 1) produce strings for using in program source files.
> 2) produce strings for display in various UIs
>
> The solutions should IMO be different, because the first is not about
> displaying these characters, while the second is about displaying
> them.
No, they are not different for my purposes since I want to have the
ability to copy strings from the UI to a source file. Working around the
problem on the display level (glyphless-display-mode) will preclude this
use case.
> For 1), is print-escape-multibyte satisfactory? If not, why not?
I already explained this. `print-escape-multibyte` obfuscates the string
too much, which is undesirable for a debugging UI. Note that I am
passing on this experience report from a Russian user who observed that
Marginalia (which currently uses `print-escape-multibyte=t`) produces
output which is not as helpful as it could be thanks to the escaping of
all multi byte characters. The escaping hurts users of multi-byte languages.
> For 2), we now have in Emacs 29 the glyphless-display-mode, whereby
> the bidi control characters are shown as small boxes with their
> acronyms (RLE, FSI, PDI, etc.). Is that satisfactory? If not, why
> not?
The `glyphless-display-mode` would be a possible workaround if I just
pass on the characters unescaped. However I want to produce strings
which I can possibly copy to source code buffers. This is not possible
if the strings are not escaped and contain the problematic control
characters in literal form.
Once again - I propose the addition of configuration variables which
configure `prin1-string` to produce output where all control characters
are escaped. I would even argue that current variable
`print-escape-control-characters` is misleading since it only encodes
Ascii control characters. Is there anything which prevents the addition
of a configuration variable `print-escape-unicode-control-characters`,
which ensures full escaping of *all control characters* or we could even
further and add `print-escape-glyphless-characters` which would treat
the same characters as `glyphless-display-mode`.
next prev parent reply other threads:[~2021-12-13 18:13 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 [this message]
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
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=2511c498-1e36-07b2-b9b8-5849902cd416@daniel-mendler.de \
--to=mail@daniel-mendler.de \
--cc=52459@debbugs.gnu.org \
--cc=eliz@gnu.org \
/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).