From unknown Fri Jun 20 07:26:23 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#33840 <33840@debbugs.gnu.org> To: bug#33840 <33840@debbugs.gnu.org> Subject: Status: electric-pair-mode breaks self-insert-command Reply-To: bug#33840 <33840@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:26:23 +0000 retitle 33840 electric-pair-mode breaks self-insert-command reassign 33840 emacs submitter 33840 Alan Mackenzie severity 33840 normal tag 33840 wontfix thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 22 21:45:45 2018 Received: (at submit) by debbugs.gnu.org; 23 Dec 2018 02:45:45 +0000 Received: from localhost ([127.0.0.1]:60382 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gatlw-0007c0-Rn for submit@debbugs.gnu.org; Sat, 22 Dec 2018 21:45:45 -0500 Received: from eggs.gnu.org ([208.118.235.92]:37710) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gatlu-0007bk-JU for submit@debbugs.gnu.org; Sat, 22 Dec 2018 21:45:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gatlo-0007mn-QJ for submit@debbugs.gnu.org; Sat, 22 Dec 2018 21:45:37 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:35106) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gatlo-0007mW-N8 for submit@debbugs.gnu.org; Sat, 22 Dec 2018 21:45:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37768) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gatln-0001ci-VU for bug-gnu-emacs@gnu.org; Sat, 22 Dec 2018 21:45:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gatlj-0007e0-24 for bug-gnu-emacs@gnu.org; Sat, 22 Dec 2018 21:45:35 -0500 Received: from colin.muc.de ([193.149.48.1]:11608 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1gatli-0007V6-Nh for bug-gnu-emacs@gnu.org; Sat, 22 Dec 2018 21:45:31 -0500 Received: (qmail 24482 invoked by uid 3782); 23 Dec 2018 02:45:27 -0000 Received: from acm.muc.de (p2E5D5238.dip0.t-ipconnect.de [46.93.82.56]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 23 Dec 2018 03:45:26 +0100 Received: (qmail 4298 invoked by uid 1000); 23 Dec 2018 02:38:41 -0000 Date: Sun, 23 Dec 2018 02:38:41 +0000 To: bug-gnu-emacs@gnu.org Subject: electric-pair-mode breaks self-insert-command Message-ID: <20181223023841.GA4289@ACM> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.3 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.3 (-----) Hello, Emacs. In the master branch, put the following into *scratch* and evaluate it: (defun s-i-c () (interactive) (self-insert-command 1)) (local-set-key "(" 's-i-c)) On typing "(", it will be seen that the self-insert-command does its job, correctly entering "(" into *scratch*. Now do M-x electric-pair-mode. If you now type "(", self-insert-command wrongly enters "()" into the buffer. This is a bug, and is the root cause of bug #33794. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 09 18:39:06 2019 Received: (at 33840) by debbugs.gnu.org; 9 Jul 2019 22:39:06 +0000 Received: from localhost ([127.0.0.1]:34475 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkylO-0007Li-84 for submit@debbugs.gnu.org; Tue, 09 Jul 2019 18:39:06 -0400 Received: from quimby.gnus.org ([80.91.231.51]:55080) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkylM-0007La-KU for 33840@debbugs.gnu.org; Tue, 09 Jul 2019 18:39:05 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hkylI-0001aq-IZ; Wed, 10 Jul 2019 00:39:02 +0200 From: Lars Ingebrigtsen To: Alan Mackenzie Subject: Re: bug#33840: electric-pair-mode breaks self-insert-command References: <20181223023841.GA4289@ACM> Date: Wed, 10 Jul 2019 00:39:00 +0200 In-Reply-To: <20181223023841.GA4289@ACM> (Alan Mackenzie's message of "Sun, 23 Dec 2018 02:38:41 +0000") Message-ID: <87r26yq1dn.fsf@mouse.gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Alan Mackenzie writes: > In the master branch, put the following into *scratch* and evaluate it: > > (defun s-i-c () > (interactive) > (self-insert-command 1)) > (local-set-key "(" 's-i-c)) > > On typing "(", it will be see [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 33840 Cc: 33840@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Alan Mackenzie writes: > In the master branch, put the following into *scratch* and evaluate it: > > (defun s-i-c () > (interactive) > (self-insert-command 1)) > (local-set-key "(" 's-i-c)) > > On typing "(", it will be seen that the self-insert-command does its > job, correctly entering "(" into *scratch*. > > Now do M-x electric-pair-mode. > > If you now type "(", self-insert-command wrongly enters "()" into the > buffer. This is a bug, and is the root cause of bug #33794. I must be misunderstanding something -- isn't the entire point of electric-pair-mode that it inserts the corresponding parenthesis when self-insert-command is called on one of the magical characters? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 10 05:40:04 2019 Received: (at 33840) by debbugs.gnu.org; 10 Jul 2019 09:40:04 +0000 Received: from localhost ([127.0.0.1]:34833 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hl952-00062P-5O for submit@debbugs.gnu.org; Wed, 10 Jul 2019 05:40:04 -0400 Received: from colin.muc.de ([193.149.48.1]:42931 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1hl94y-00061q-63 for 33840@debbugs.gnu.org; Wed, 10 Jul 2019 05:40:03 -0400 Received: (qmail 48495 invoked by uid 3782); 10 Jul 2019 09:39:58 -0000 Received: from acm.muc.de (p4FE15E52.dip0.t-ipconnect.de [79.225.94.82]) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 10 Jul 2019 11:39:56 +0200 Received: (qmail 4131 invoked by uid 1000); 10 Jul 2019 09:39:56 -0000 Date: Wed, 10 Jul 2019 09:39:56 +0000 To: Lars Ingebrigtsen Subject: Re: bug#33840: electric-pair-mode breaks self-insert-command Message-ID: <20190710093956.GA4109@ACM> References: <20181223023841.GA4289@ACM> <87r26yq1dn.fsf@mouse.gnus.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87r26yq1dn.fsf@mouse.gnus.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 33840 Cc: 33840@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Lars. On Wed, Jul 10, 2019 at 00:39:00 +0200, Lars Ingebrigtsen wrote: > Alan Mackenzie writes: > > In the master branch, put the following into *scratch* and evaluate it: > > (defun s-i-c () > > (interactive) > > (self-insert-command 1)) > > (local-set-key "(" 's-i-c)) > > On typing "(", it will be seen that the self-insert-command does its > > job, correctly entering "(" into *scratch*. > > Now do M-x electric-pair-mode. > > If you now type "(", self-insert-command wrongly enters "()" into the > > buffer. This is a bug, and is the root cause of bug #33794. > I must be misunderstanding something -- isn't the entire point of > electric-pair-mode that it inserts the corresponding parenthesis when > self-insert-command is called on one of the magical characters? But the entire point of (self-insert-command 1) is to insert exactly one copy of what was just typed. With electric-pair-mode enabled, it no longer does this; it does something else instead. self-insert-command is a primitive, and it shouldn't be modified to do other things. Instead these other things should be done alongside the primitive, or after it. Similarly, you would not modify + such that (+ 2 3) => 6, even if you had a use case where you wanted this strange arithmetic. Because of this change to self-insert-command, other uses of it (other than when bound directly to a key) fail. This happened in bug #33794 where this change to self-insert-command broke c-electric-brace. This has since been worked around by other means. Being realistic, I now don't really expect this bug to be fixed. It would cost too much. But if you are going to close it, please mark it as "won't fix" and _not_ "not a bug". Thanks! > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 10 07:34:33 2019 Received: (at 33840) by debbugs.gnu.org; 10 Jul 2019 11:34:33 +0000 Received: from localhost ([127.0.0.1]:34925 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hlAro-0006o9-W3 for submit@debbugs.gnu.org; Wed, 10 Jul 2019 07:34:33 -0400 Received: from quimby.gnus.org ([80.91.231.51]:36026) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hlArm-0006o0-Bd for 33840@debbugs.gnu.org; Wed, 10 Jul 2019 07:34:31 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hlAri-0008Ek-C9; Wed, 10 Jul 2019 13:34:28 +0200 From: Lars Ingebrigtsen To: Alan Mackenzie Subject: Re: bug#33840: electric-pair-mode breaks self-insert-command References: <20181223023841.GA4289@ACM> <87r26yq1dn.fsf@mouse.gnus.org> <20190710093956.GA4109@ACM> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXa2djt7eyjoZ/k5OL+ //79/f3Ozcu+vbvUGkYsAAACbUlEQVQ4jbWPQY/bIBCFh0WBayjr3WuWSuYKQeucI/UHxHV3eyWx CleHaJm/38HaVlXV3tqJjZT38d4bw6e/DPx7cDF7Y2q25e03oGiCV2q8/0PUZfeftjq+3Hfq2L2o o3pR6mXsuu44fulGoEXGsaOD1hpV9/OAcZWaOoZf2Ahk7byaVOg6HVZxZR1FKa2U95ruB0Ws+YhQ lOp8mJra3uC1Hn3rUJ4FPWn6T4Te8Bx8iwOvp4n0QIhuB6b96u1g9DTPwXnwIfjANScLdQIn3Tnt mQPVHrZtcUqDnk5bz3jYauD0bGFq1knDc+BnDm7LuGuyage1KdDMnU6nLUuOicSAB9AuTCHA9kT3 4TwLnkJKWmzIwjcENvG8YVwMbhbRJSYiSQBaw0m8PgyCz3FwaR4ag+iBeQDGYT7HNMxcJC7mB0qE LVUxYFEMwyNUASk+JJfgAZgL8CpeJYF4wxQhrSxA8hTzFq/fzkuSoqYoq6s8UWjUQM3DkHOOi0h1 wDkvcxKO3CKKKOPtVnNMOeYKGA8pugjzTCqmLCUdGDFK5DHR13wVj4d9fjzkijXiInHIbb9E5fVa r0tfMdvaLIQjgIBHKQeUWC5YsdTcJ6yyEoElStpJ1l2PtVhpF8RKKwS41Xrtn2xvS7HZNEaEKkDu P8jL57LfX9BYNLJUakIiy7I87eyut9YWUw2tkGtCRDgcqDkXNIVeYn2h76Ef1Frxcil3xVqDpjem VbStbsuu7z9SEmm2WCxmbeBw16Y57ooxxVBeM2Gl8h1ZemNNG4KNWCqnCkTzY2zT1qEoqqZpl1eX pYpWbvr3eQ9bc4h9B6WuB3+i6A6mAAAAAElFTkSuQmCC Date: Wed, 10 Jul 2019 13:34:26 +0200 In-Reply-To: <20190710093956.GA4109@ACM> (Alan Mackenzie's message of "Wed, 10 Jul 2019 09:39:56 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Alan Mackenzie writes: > self-insert-command is a primitive, and it shouldn't be modified to do > other things. Instead these other things should be done alongside the > primitive, or after it. > > Similarly, you would not [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 33840 Cc: 33840@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Alan Mackenzie writes: > self-insert-command is a primitive, and it shouldn't be modified to do > other things. Instead these other things should be done alongside the > primitive, or after it. > > Similarly, you would not modify + such that (+ 2 3) =3D> 6, even if you h= ad > a use case where you wanted this strange arithmetic. I agree that modifying primitives is really confusing and should be avoided, but I don't think self-insert-command is ... very primitive. :-) I mean, look at the doc string: --- (self-insert-command N &optional C) Probably introduced at or before Emacs version 22.1. Insert the character you type. Whichever character C you type to run this command is inserted. The numeric prefix argument N says how many times to repeat the insertion. Before insertion, =E2=80=98expand-abbrev=E2=80=99 is executed if the insert= ed character does not have word syntax and the previous character in the buffer does. After insertion, =E2=80=98internal-auto-fill=E2=80=99 is called if =E2=80=98auto-fill-function=E2=80=99 is non-nil and if the =E2=80=98auto-fi= ll-chars=E2=80=99 table has a non-nil value for the inserted character. At the end, it runs =E2=80=98post-self-insert-hook=E2=80=99. --- There's a lot of stuff going on there! It sounds more like a "don't use this function from code unless you want unpredictable things to happen" thing to me... > Being realistic, I now don't really expect this bug to be fixed. It > would cost too much. But if you are going to close it, please mark it as > "won't fix" and _not_ "not a bug". Will do. :-) --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 10 07:34:43 2019 Received: (at control) by debbugs.gnu.org; 10 Jul 2019 11:34:43 +0000 Received: from localhost ([127.0.0.1]:34928 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hlArz-0006ob-AW for submit@debbugs.gnu.org; Wed, 10 Jul 2019 07:34:43 -0400 Received: from quimby.gnus.org ([80.91.231.51]:36040) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hlArx-0006oT-K9 for control@debbugs.gnu.org; Wed, 10 Jul 2019 07:34:41 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hlArv-0008Ew-1g for control@debbugs.gnu.org; Wed, 10 Jul 2019 13:34:41 +0200 Date: Wed, 10 Jul 2019 13:34:38 +0200 Message-Id: To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #33840 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 33840 wontfix close 33840 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 33840 wontfix close 33840 quit From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 10 13:08:33 2019 Received: (at 33840) by debbugs.gnu.org; 10 Jul 2019 17:08:33 +0000 Received: from localhost ([127.0.0.1]:36510 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hlG53-00014Z-JK for submit@debbugs.gnu.org; Wed, 10 Jul 2019 13:08:33 -0400 Received: from mail-io1-f52.google.com ([209.85.166.52]:39688) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hlG50-00014I-Go for 33840@debbugs.gnu.org; Wed, 10 Jul 2019 13:08:32 -0400 Received: by mail-io1-f52.google.com with SMTP id f4so6331843ioh.6 for <33840@debbugs.gnu.org>; Wed, 10 Jul 2019 10:08:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=lxAvTSp1lbPg3MHcvQfmpMKYPxs20s64RQYzJ/pbVoA=; b=KFU2uwuUsCwJIpM7xKDScwl1XJhLy9Vm5PcY/VISAXewOOR+Iu5txrOtMBDH3BTTp3 Qyj5geTLJfbKVfQEq2hPFTfOSO94E+70YXqk4HLyEI5qhlb1VVtlshgc/vWOj/FPEhgQ SIk2Hfre9GIzGAZpk+tvXanrSXHQw97FM+sF4CT89O5JzLD2gisDmYERDcX9nqT49Lsa i4oRPbQxO1s1OAL2XUi9nNoPbiF6/TEiHwmlYiov+cp6zZzKeYDpOjOoL7f4wItGs8cG iqPA8KSuQJdNzkGqKIOFUcRJujDCwHErIl63QLb8JOufoHszEpQaaSzxTAUe4oMJqGnL D6vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=lxAvTSp1lbPg3MHcvQfmpMKYPxs20s64RQYzJ/pbVoA=; b=WChd9v1CnscD3ZO+Z7cgrV6c+uNwAn6BnO0wIuliTFWDiRvoOaIpkU4qWo7tbysc5t vfcta2COqYhMinbe8/t2Zkl44y3LZKSh0v2BN+cs1KAPg8ATvZjPgfFga7QEBoNduyOj sXkYgIa6wxObmnl7u3LwW1Wq7CYoTocS/KCFAKg1lw1bgZ4UThzuRVOmkPwLtnID6aRa DV27pcKU7elJruuWqB4K2+ZE5zurZu3nlVuyY4zL4X2BLFU1p0VJn+cLeW8FLS9PmFXZ gC889mfnD6F4Z0A6IO+VmD9Elz+G5aIyfMtdmPeFbqYUbU57UKlLsIhjB11t6zuWrw48 nB/A== X-Gm-Message-State: APjAAAVr9yTID6aO3/7Y/PJuQhKhWeTgWflh5I1dWCubNwjCDFq9QAUF Irhn8aZroj4v78wzUHJ+eNw4Dg5Q X-Google-Smtp-Source: APXvYqw1QC5Mi5ycWVbsIdpUfBxiP7coly5hORkjpyYYzxZg5jBLc8IXXFJoPYJHgCu/20lhRh38yg== X-Received: by 2002:a5d:9d42:: with SMTP id k2mr14363632iok.45.1562778504699; Wed, 10 Jul 2019 10:08:24 -0700 (PDT) Received: from vhost2 (CPE001143542e1f-CMf81d0f809fa0.cpe.net.cable.rogers.com. [99.230.51.196]) by smtp.gmail.com with ESMTPSA id l2sm1891836ioh.20.2019.07.10.10.08.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jul 2019 10:08:24 -0700 (PDT) From: Noam Postavsky To: Lars Ingebrigtsen Subject: Re: bug#33840: electric-pair-mode breaks self-insert-command References: <20181223023841.GA4289@ACM> <87r26yq1dn.fsf@mouse.gnus.org> <20190710093956.GA4109@ACM> Date: Wed, 10 Jul 2019 13:08:24 -0400 In-Reply-To: (Lars Ingebrigtsen's message of "Wed, 10 Jul 2019 13:34:26 +0200") Message-ID: <85sgrdddh3.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.92 (windows-nt) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Lars Ingebrigtsen writes: > Alan Mackenzie writes: > >> self-insert-command is a primitive, and it shouldn't be modified to do >> other things. Instead these other things should be done alongside the >> primitive, or after i [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: gnus.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (npostavs[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.166.52 listed in list.dnswl.org] 1.3 PDS_NO_HELO_DNS High profile HELO but no A record X-Debbugs-Envelope-To: 33840 Cc: Alan Mackenzie , 33840@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) Lars Ingebrigtsen writes: > Alan Mackenzie writes: > >> self-insert-command is a primitive, and it shouldn't be modified to do >> other things. Instead these other things should be done alongside the >> primitive, or after it. >> >> Similarly, you would not modify + such that (+ 2 3) => 6, even if you had >> a use case where you wanted this strange arithmetic. > > I agree that modifying primitives is really confusing and should be > avoided, but I don't think self-insert-command is ... very primitive. > :-) I mean, look at the doc string: [...] > There's a lot of stuff going on there! It sounds more like a "don't use > this function from code unless you want unpredictable things to happen" > thing to me... > >> Being realistic, I now don't really expect this bug to be fixed. It >> would cost too much. FWIW, I don't think using a documented hook should be considered "modifying" the primitive which calls it (unlike say, using advice). But electric-pair-mode's current implementation seems to involve a complicated dance of inserting and deleting and inserting characters again, so I think there is some room for improvement. Perhaps by using something other than post-self-insert-hook. From unknown Fri Jun 20 07:26:23 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 08 Aug 2019 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator