[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#27270: display-raw-bytes-as-hex generates ambiguous output for Emacs

From: Paul Eggert
Subject: bug#27270: display-raw-bytes-as-hex generates ambiguous output for Emacs strings
Date: Fri, 9 Jun 2017 16:44:46 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1

Eli Zaretskii wrote:
What do you think of using capital X for hexadecimal escapes with at
most two digits? That way, "\X905" would be a two-character string,
which is what is wanted here. Or we could use small h for hexadecimal,
and "\h905".
I'm okay, but I'm not sure I understand how does this fix your
problem.  Can you explain?

The idea is to add a new \X escape for character constants and strings. This escape would allow at most two hexadecimal digits, rather than the unlimited number of digits that \x does. For example, the Lisp string "\XABC" would be equivalent to the Lisp string "\xAB\ C", that is, it would be a two-character string containing the character U+00AB LEFT POINTING GUILLEMET followed by the character U+0043 LATIN CAPITAL LETTER C.

Also, display-raw-bytes-as-hex would cause raw bytes to be displayed with this new X escape, rather than with with the x escape.

This would fix my problem, since I would continue to be able to copy text displayed in a terminal window, and paste it into an Emacs string, and get the text unaltered even if display-raw-bytes-as-hex is t.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]