From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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:07:13 +0200 Message-ID: <83wnk8l9ha.fsf@gnu.org> References: <83v8ztmu75.fsf@gnu.org> <93d63756-f75d-c53e-de02-2e8270d07311@daniel-mendler.de> <83r1agn184.fsf@gnu.org> <0eabc668-ecb2-8f77-17cf-f9cb6dcf0626@daniel-mendler.de> <0504d4a8-1a4b-a451-d7d3-fea1c116b96d@daniel-mendler.de> <8335mwmssm.fsf@gnu.org> <7027aad4-d156-12ae-7356-4d55be5716b1@daniel-mendler.de> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31463"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 52459@debbugs.gnu.org To: Daniel Mendler Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 13 18:12:45 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mwosX-0007z5-EB for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 13 Dec 2021 18:12:45 +0100 Original-Received: from localhost ([::1]:60990 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mwosW-000138-C7 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 13 Dec 2021 12:12:44 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59254) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwony-0004E1-T1 for bug-gnu-emacs@gnu.org; Mon, 13 Dec 2021 12:08:06 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45134) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mwony-0000Kn-KZ for bug-gnu-emacs@gnu.org; Mon, 13 Dec 2021 12:08:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mwony-0007jp-B9 for bug-gnu-emacs@gnu.org; Mon, 13 Dec 2021 12:08:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Dec 2021 17:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52459 X-GNU-PR-Package: emacs Original-Received: via spool by 52459-submit@debbugs.gnu.org id=B52459.163941524929702 (code B ref 52459); Mon, 13 Dec 2021 17:08:02 +0000 Original-Received: (at 52459) by debbugs.gnu.org; 13 Dec 2021 17:07:29 +0000 Original-Received: from localhost ([127.0.0.1]:56680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwonR-0007j0-Cu for submit@debbugs.gnu.org; Mon, 13 Dec 2021 12:07:29 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58358) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwonM-0007ik-MU for 52459@debbugs.gnu.org; Mon, 13 Dec 2021 12:07:28 -0500 Original-Received: from [2001:470:142:3::e] (port=37182 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwonH-0000Fi-4E; Mon, 13 Dec 2021 12:07:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=EQ49dzMRDwzYkrNfVlmlaTWlnqPNwxiUQw3McFDs8Ro=; b=CNP2c3c5ffOR nHCKQmGU17c+h4An5tOTvhG++JLIG4MtJCsgTWVmn4lX07BlKZbXUQF8ns+Ylr0PudgsJ1mgseBQi gPLZfUaEsSe9mZR5mQ86hqu5Bnhbvt0ZqAApOj3G6eg8TigH39SnKeU1yFBHMWIlQHRupelEwyhJk m+SMYRXXumAXyiUiobCrS/gq59UgPUDIjvX6O9uz3s8mfMZenmVatompS1HTjvtKlunhRLu6W1xB/ 5ywX//jg6AhJlvbcnVPu274Zey1c+rGIYeIGvWajX/RqVtXTNll9VaDGsNLBO41U9hATb9Hm1gMOp 1wxyBrWyC4vVuWpNUTGQfg==; Original-Received: from [87.69.77.57] (port=2263 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwonG-0006TS-TY; Mon, 13 Dec 2021 12:07:19 -0500 In-Reply-To: <7027aad4-d156-12ae-7356-4d55be5716b1@daniel-mendler.de> (message from Daniel Mendler on Mon, 13 Dec 2021 17:32:40 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:222331 Archived-At: > Cc: 52459@debbugs.gnu.org > From: Daniel Mendler > Date: Mon, 13 Dec 2021 17:32:40 +0100 > > On 12/13/21 4:24 PM, Eli Zaretskii wrote: > > So you want a feature that would produce strings suitable for using in > > program source files, like we did in the above example? Is that the > > meaning of "sanitize" you have been using? > > > > Are there other use cases for those "escaped" or "sanitized" strings? > > If so, please describe them as well. > > As you said the use case is to produce strings suitable in source files > or strings in a form which looks like strings occurring in source files. > This use case appears in debuggers and other UIs which inspect variable > values at Emacs runtime. Furthermore code editing and refactoring tools > produce strings which are supposed to be used directly in source files. > > For the usage of strings in source files on could simply use > `print-escape-multibyte=t` however in particular in debugger UIs this > leads to a severe obfuscation of the output, which in particular hurts > users wo use Emacs in a setup with a multi-byte bidi language, Hebrew, > Arabic, Chinese, etc. Therefore in debugger UIs I only want to escape > control characters but not other multi-byte display characters. So there are two different use cases: 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. For 1), is print-escape-multibyte satisfactory? If not, why not? 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?