unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
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:57:54 +0100	[thread overview]
Message-ID: <e7040003-e807-ed3b-db01-c0615ebd8b3e@daniel-mendler.de> (raw)
In-Reply-To: <83sfuwl4mf.fsf@gnu.org>

On 12/13/21 7:52 PM, Eli Zaretskii wrote:
> Not only is it unreasonable, it is simply impossible.  Representing
> characters _on_display_ and writing such a representation into a file,
> as in simple.el, are two different and incompatible goals.  The
> solutions for them must be separate.  I already explained why, and if
> my explanations still don't convince you, then I'm sorry, but I cannot
> help you more than that, because it means we don't have a common
> language and understanding to discuss this stuff.

I produce strings from Elisp values using `prin1-to-string`. These
strings should be escaped such that I can use copy them to source files
as is. Furthermore when I display the string in the UI, the string
should not mess up the display. This requires the string to not have
control characters.

You are seriously misunderstanding what I am proposing.

Please consider my proposal: I propose the addition of a variable
`print-escape-unicode-control-characters` which ensures that
`prin1-to-string` returns a string where all control characters are
escaped. This proposal is certainly not impossible.

Currently `prin1-to-string` produces a string which contains bidi
control characters despite `print-escape-control-characters=t`.

>>>> Once again - I propose the addition of configuration variables which
>>>> configure `prin1-string` to produce output where all control characters
>>>> are escaped.
>>>
>>> That could help in case 1), but not in case 2), because there prin1 is
>>> not used, or not necessarily used.
>>
>> I am only taking about prin1. The issue is about prin1. My goal is to
>> produce safely escaped string representations of Elisp values, including
>> strings and other values.
> 
> Once again: prin1 will not help with displaying these characters.
> Emacs doesn't use prin1 to display text.

Of course not. I am using prin1 to create a string from a value which I
can then copy to a source file or display somewhere in the UI.





  reply	other threads:[~2021-12-13 18:57 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 [this message]
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=e7040003-e807-ed3b-db01-c0615ebd8b3e@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).