From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#55738: character escape bugs in the reader Date: Tue, 31 May 2022 13:33:09 +0200 Message-ID: <20BC6F3C-1C72-4469-946D-8B9583C73024@acm.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22736"; mail-complaints-to="usenet@ciao.gmane.io" To: 55738@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 31 13:39:27 2022 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 1nw0Df-0005iN-4Y for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 31 May 2022 13:39:27 +0200 Original-Received: from localhost ([::1]:52808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nw0Dd-0003rP-RY for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 31 May 2022 07:39:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nw08R-00081r-8h for bug-gnu-emacs@gnu.org; Tue, 31 May 2022 07:34:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52947) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nw08Q-0004xp-8w for bug-gnu-emacs@gnu.org; Tue, 31 May 2022 07:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nw08Q-0004eW-6U for bug-gnu-emacs@gnu.org; Tue, 31 May 2022 07:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 31 May 2022 11:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 55738 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.165399681717841 (code B ref -1); Tue, 31 May 2022 11:34:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 31 May 2022 11:33:37 +0000 Original-Received: from localhost ([127.0.0.1]:46844 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nw081-0004dh-8S for submit@debbugs.gnu.org; Tue, 31 May 2022 07:33:37 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:53644) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nw080-0004dZ-3Q for submit@debbugs.gnu.org; Tue, 31 May 2022 07:33:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55622) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nw07y-0007dP-SH for bug-gnu-emacs@gnu.org; Tue, 31 May 2022 07:33:34 -0400 Original-Received: from mail205c50.megamailservers.eu ([91.136.10.215]:51868 helo=mail193c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nw07v-0004rJ-RD for bug-gnu-emacs@gnu.org; Tue, 31 May 2022 07:33:34 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1653996797; bh=lXJBVtPKQluBo+W4Fz1qewujIWUMhRhtRAxi4wTwaxE=; h=From:Subject:Date:To:From; b=NeAIZs7oOp83xhJY+Y+V2un0Sw4rej5oqb+Sr99FAcDQFis+Jow/cOaxe4niIEtPk cxqBBYo+EBY2zCLJhVnm9nLAipUuLF2tz/03yliccU61TgYae7zvcZbLeUFLjnhPmR 1flQvXQBmEh6KvBJpcO0G4H1k6xsB+kJ2g7ZdaBw= Feedback-ID: mattiase@acm.or Original-Received: from smtpclient.apple (c188-150-171-71.bredband.tele2.se [188.150.171.71]) (authenticated bits=0) by mail193c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 24VBX9up003744 for ; Tue, 31 May 2022 11:33:16 +0000 X-Mailer: Apple Mail (2.3654.120.0.1.13) X-CTCH-RefID: str=0001.0A742F17.6295FCFC.0050, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-Origin-Country: SE Received-SPF: softfail client-ip=91.136.10.215; envelope-from=mattiase@acm.org; helo=mail193c50.megamailservers.eu X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action 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:233426 Archived-At: Some character escape oddities observed in the Emacs reader: 1. ?\LF =3D> -1 This is clearly a bug (no character literal should be -1) and an = artefact of the underlying implementation. The correct value should be 10. (In string literals \LF is ignored entirely, as documented.) 2. The Control modifier (\C- or \^) is nonidempotent. For example, ?\C-a =3D> 1 ?\C-\C-a =3D> #x4000001 Similarly, "\C-\C-a" signals a reader error. This too is an artefact of the implementation. The correct value should = be as if only a single control modifier were present, eg. ?\C-\C-a =3D> = 1. 3. Control-space yields NUL in strings but not as a char literal: "\C-SPC" =3D> "NUL" "\^SPC" =3D> "NUL" ?\C-SPC =3D> #x4000020 ?\^SPC =3D> #x4000020 Emacs takes a conservative stance and normally only generates control = characters from upper and lower case ASCII letters and the symbols = ?@[\]^_ because that agrees with custom and suffices for all C0 = controls. Since most terminals also map Control-SPC to NUL, it would be = more consistent to do so in both string and character literals. The first two bugs are straightforward to fix (I have a patch) and doing = so is unlikely to cause any harm. I honestly don't think making ?\C-SPC =3D> 0 would either (because of = how key binding words) but we should investigate further just in case.