From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#71337: 30.0.50; `electric-pair-mode' and custom keybinding Date: Tue, 04 Jun 2024 10:18:07 +0200 Message-ID: <87r0dd15q8.fsf@gmx.net> References: <87frtu9lts.fsf@gmx.net> <877cf52mib.fsf@gmx.net> Reply-To: Stephen Berman Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24594"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Arash Esbati , Stefan Monnier , 71337@debbugs.gnu.org To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 04 10:19:20 2024 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 1sEPO3-0006Fg-TD for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 04 Jun 2024 10:19:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEPNd-0000yK-Ne; Tue, 04 Jun 2024 04:18:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sEPNY-0000xE-V5 for bug-gnu-emacs@gnu.org; Tue, 04 Jun 2024 04:18:48 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEPNY-00057W-MF for bug-gnu-emacs@gnu.org; Tue, 04 Jun 2024 04:18:48 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sEPNl-00022L-UD for bug-gnu-emacs@gnu.org; Tue, 04 Jun 2024 04:19:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 04 Jun 2024 08:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71337 X-GNU-PR-Package: emacs Original-Received: via spool by 71337-submit@debbugs.gnu.org id=B71337.17174891147790 (code B ref 71337); Tue, 04 Jun 2024 08:19:01 +0000 Original-Received: (at 71337) by debbugs.gnu.org; 4 Jun 2024 08:18:34 +0000 Original-Received: from localhost ([127.0.0.1]:56317 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEPNJ-00021a-LQ for submit@debbugs.gnu.org; Tue, 04 Jun 2024 04:18:34 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:33075) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEPNH-00021E-O7 for 71337@debbugs.gnu.org; Tue, 04 Jun 2024 04:18:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1717489088; x=1718093888; i=stephen.berman@gmx.net; bh=RAYxWSpLfwRiAaHPoJwFBJ0mHF/ZkY/jn1mHJVGS3+M=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=n/SJ2VXG3DRvVzdahLRlcHEws6YBbKULZJsBot0jT0Oprs7AntHfS2xwu7+Snouy zeEobDNWtZRrsbbzXWasw2x3i18/Zl5cgeRAkMO3FkgwUCbc8zGroCnszin5OuE9r soLQ0CAp/vH2VKZcHC2u6MC9Z8JEPb4xFwbrHAtoMlwVoTsaUCX8uPMMuneKVtvgY vSM9Qqxg56pCxxnMRaNQ7zpTiz5Nv189Dnd8DdNfLW3+/5Xfk7Y7iQZAsl2OD+vCP Zxj27BgoTg3VJBFPLLXKX7THgSqK5uAxR95NbeBb2BixXObFEAtRXL7OmGg0mRBd/ Ix/IduetPh9zjItAog== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from strobelfs ([94.134.94.117]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MRmfi-1s2omz3j3K-00SOid; Tue, 04 Jun 2024 10:18:07 +0200 In-Reply-To: ("=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?="'s message of "Tue, 4 Jun 2024 09:08:51 +0100") X-Provags-ID: V03:K1:xlQx4UxrBYN2wfU0iwUvSytZ5I31mBg2gXEV59+2ZkqZA7eSkzb 67ZcIkxoi5XCtE4tNPtYJ359UBvtf5No8r2zjfqNY5ew8iH/k8A/B4/75CNz6VkpPNQGs70 zi4ciUxSQ2RDqtnWfHcvr66LEt7F3wWpxyeR+XwX2M4SC1O4pjMU05Qwx3Xy4kRmkc+fTPN kbO+qG3UkQ19VVBYCn2qg== UI-OutboundReport: notjunk:1;M01:P0:gD6zpYlGsV4=;iudGRs5S+Uit0caNHT/o79zeulp pwYTfuaSQVWOVaKOP76QJMfrphAvILQ9D/BRBFC5TKxboVmkqAXCY4E7+KDkPipROM/0jnkgB 5F4OKAlwBEdpoBIbw4u2Wip0mH6u2HrpLtX4oXqNRyKyLwe7M/PY/CI8qO8m5AcyFPDfmSLNs CnACpp3KL5XGqQ7QOo2MrLaAXUw5Tqyz+RPdCGTXxUP79DczsDtQ8h6fuspf0gaIJfqw4AbTA gkPQ3zqEFGQF8Y8ygBQqZNxEKIq6NLReEnsGiTUzRARz6wvkL9CITFAGTLWDVyS4d9maRBvaP z8UuQ+yF7OLF8g7qRaL7CjSqJZ8C+3a1NRtwaXwZRXpLm50ncHGuG2bYgyqdXFZYEb+S2skMJ 17DZ17gtjP1RQpykdTyZALP1G7wtO5mFtyNmvj+IzsvxbbsAi9eP5X7y8gyk5/cheGGdrUmV9 SKPjczty5UBwTTrKzKrtPfFn67rSAcKOrlxHcqOGKopn+KY28/+rdkKr6JSU3kp91QTtLMnE8 +dcymF9pdvjRsmZ+pwLbT6ZTollWQri+xnQH/Ymr6v6f/xKY6+J5v/+bCD5M8qe7rhr+fMu5L 40VSt2EpF317BJRyLjVVsllrg39+uGpCW5I2lfDfX79bw+KN8b4ZoAAGnqMIhDQ7TQ3Vdqn2b estp7L1oPfO4yd29HhVKy4VknF6WH2xbVmm+5cqcvENfALyg/QZhGifSkCMSzp33FPkwv5WiP yArbZR1vuQnt/mP7XOi6Db9TznBGPQxrkFFDdMqp4NlGCZmj4C882WVoS+TqMSo+ZnEJ1Y02 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:286524 Archived-At: On Tue, 4 Jun 2024 09:08:51 +0100 Jo=C3=A3o T=C3=A1vora wrote: > On Tue, Jun 4, 2024 at 8:37=E2=80=AFAM Jo=C3=A3o T=C3=A1vora wrote: >> >> On Tue, Jun 4, 2024 at 8:30=E2=80=AFAM Stephen Berman wrote: >> > >> > On Tue, 04 Jun 2024 07:53:16 +0200 Arash Esbati wrote: >> > >> > > Stephen Berman writes: >> > > >> > >> If the pairing in electric-pair-mode should only be triggered by >> > >> self-inserting characters (as the current code seems to require), t= hen >> > >> the attached patch appears to avoid the above problem. >> > > >> > > Thanks for your response. Yes, your patch fixes the issue. Do you = want >> > > to install it? >> > >> > I think it would be prudent to wait for someone familiar with the >> > electric-pair-mode implementation (e.g. its author Jo=C3=A3o T=C3=A1vo= ra, Cc'd), >> > or failing that, an Emacs maintainer, to ok the patch. >> >> I will have a look if I can. It would also be prudent to make sure >> the unit tests all pass, like they presumably do before the patch. > > I've had a look. it looks like the problems is e-p-mode's assumption > that last-command-event is the thing to be inserted. The fact that > it isn't here (somehow an innocent 92 is now a monstrous 8388643), > triggers the problem (8388643 isn't a representation of a character, > apparently). Right, because (max-char) =3D> 4194303 (#o17777777, #x3fffff) > But according to the docstring of post-self-insert-hook, > the assumption seems sane, and I probably coded for it. That's what I thought, too. > post-self-insert-hook is a variable defined in `src/cmds.c'. > > ... > > The hook can access the inserted character via `last-command-event'. > ... > > I don't think the patch is fully correct. I think Stefan is the right > person to call here. I've had an even briefer look at cmds.c and I > don't understand how that hook's promise is honoured. Thanks for taking a look. Steve Berman