From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#27270: display-raw-bytes-as-hex generates ambiguous output for Emacs strings Date: Wed, 07 Jun 2017 08:17:04 +0300 Message-ID: <83tw3s8jhr.fsf@gnu.org> References: <29d6844f-2f6f-11c1-7877-a9d169e613f8@cs.ucla.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1496812690 10538 195.159.176.226 (7 Jun 2017 05:18:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 7 Jun 2017 05:18:10 +0000 (UTC) Cc: 27270@debbugs.gnu.org, v.schneidermann@gmail.com To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 07 07:18:06 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dITM5-0002Rd-VV for geb-bug-gnu-emacs@m.gmane.org; Wed, 07 Jun 2017 07:18:06 +0200 Original-Received: from localhost ([::1]:41266 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dITMA-0006KC-UV for geb-bug-gnu-emacs@m.gmane.org; Wed, 07 Jun 2017 01:18:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dITM5-0006K3-Vu for bug-gnu-emacs@gnu.org; Wed, 07 Jun 2017 01:18:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dITM2-0002QS-Nx for bug-gnu-emacs@gnu.org; Wed, 07 Jun 2017 01:18:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57523) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dITM2-0002Pv-K8 for bug-gnu-emacs@gnu.org; Wed, 07 Jun 2017 01:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dITM2-0005BE-Bg for bug-gnu-emacs@gnu.org; Wed, 07 Jun 2017 01:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 07 Jun 2017 05:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27270 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27270-submit@debbugs.gnu.org id=B27270.149681264419868 (code B ref 27270); Wed, 07 Jun 2017 05:18:02 +0000 Original-Received: (at 27270) by debbugs.gnu.org; 7 Jun 2017 05:17:24 +0000 Original-Received: from localhost ([127.0.0.1]:60200 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dITLQ-0005AO-2I for submit@debbugs.gnu.org; Wed, 07 Jun 2017 01:17:24 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38476) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dITLO-0005AA-4D for 27270@debbugs.gnu.org; Wed, 07 Jun 2017 01:17:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dITLI-0001t4-2W for 27270@debbugs.gnu.org; Wed, 07 Jun 2017 01:17:16 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43191) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dITLB-0001qH-Ua; Wed, 07 Jun 2017 01:17:09 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3583 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dITLB-0005T2-3d; Wed, 07 Jun 2017 01:17:09 -0400 In-reply-to: <29d6844f-2f6f-11c1-7877-a9d169e613f8@cs.ucla.edu> (message from Paul Eggert on Tue, 6 Jun 2017 20:57:51 -0700) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:133361 Archived-At: > From: Paul Eggert > Date: Tue, 6 Jun 2017 20:57:51 -0700 > Cc: Vasilij Schneidermann > > then on the terminal display I see: > > x\x905y > > If I cut and paste this (using my windowing system) into an Emacs string, like this: > > "x\x905y" > > and then evaluate the string, the result is the string "xअy" display-raw-bytes-as-hex is a display-only feature, as its name tells, it isn't supposed to affect evaluation or the Lisp reader. So I'm unsure why you expected it to affect evaluation. It's the same if you define a display table to display one character as another, and then expect Emacs to perform the opposite transformation when it reads characters or strings. > A simple solution would be to display this instead: > > x\x90\x35y That would mean display-raw-bytes-as-hex is "viral", in that it affects not just the raw byte, but also the next character. That sounds sub-optimal, as it makes reading the result harder. > though that is awkward because it means the ASCII 0-9, a-f, A-F would be > displayed as hexadecimal escapes when they follow another hexadecimal escape. Exactly. > By the way, I expected display-raw-bytes-as-hex to affect how Emacs displays > Emacs strings, too. Shouldn't it? What do you mean by "Emacs strings"? Buffer text is a string, isn't it?