From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Mendler 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:57:54 +0100 Message-ID: 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> <83wnk8l9ha.fsf@gnu.org> <2511c498-1e36-07b2-b9b8-5849902cd416@daniel-mendler.de> <83tufcl5qd.fsf@gnu.org> <4ac4a4ce-2bb4-4120-d52d-665a029cab4e@daniel-mendler.de> <83sfuwl4mf.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12001"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 52459@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 13 19:59:33 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 1mwqXs-0002xn-ST for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 13 Dec 2021 19:59:32 +0100 Original-Received: from localhost ([::1]:41168 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mwqXr-0000gZ-Qf for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 13 Dec 2021 13:59:31 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58528) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwqXO-0000gQ-UN for bug-gnu-emacs@gnu.org; Mon, 13 Dec 2021 13:59:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45270) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mwqXO-0002KE-8L for bug-gnu-emacs@gnu.org; Mon, 13 Dec 2021 13:59:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mwqXO-0001ze-66 for bug-gnu-emacs@gnu.org; Mon, 13 Dec 2021 13:59:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Dec 2021 18:59: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.16394218887586 (code B ref 52459); Mon, 13 Dec 2021 18:59:02 +0000 Original-Received: (at 52459) by debbugs.gnu.org; 13 Dec 2021 18:58:08 +0000 Original-Received: from localhost ([127.0.0.1]:56816 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwqWV-0001yI-Ut for submit@debbugs.gnu.org; Mon, 13 Dec 2021 13:58:08 -0500 Original-Received: from server.qxqx.de ([178.63.65.180]:53835 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwqWQ-0001xk-IK for 52459@debbugs.gnu.org; Mon, 13 Dec 2021 13:58:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de; s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=HBGqlQN1YnxkcGk1a5fJD8RWj91OZpWcDfw12YyziaI=; b=XEqs7sli/y+I4Sq5vq9NOuNv09 Lp1qGhQDRdjCkFMoVcjOb9ad1xgGV4jzucdh+1vYrsJalIGlMQbq4QFt+0Dhm3SSxnjwvgPNESDUX q2olS5d1thA2Eg+v1Yfog53ZBfYoBuaxAED/CHJOCJAjGOo4QRWeCrAhXPBQTKWgVHFc=; In-Reply-To: <83sfuwl4mf.fsf@gnu.org> Content-Language: en-US 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:222338 Archived-At: 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.