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#72437: Unexpected behavior when inserting with prefix arg in electric-pair-mode Date: Sat, 03 Aug 2024 21:46:22 +0300 Message-ID: <86zfpttpfl.fsf@gnu.org> References: <87le1edqqm.fsf@breatheoutbreathe.in> <86h6c2ug0p.fsf@gnu.org> <86a5htvclm.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26664"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72437@debbugs.gnu.org, monnier@iro.umontreal.ca, joseph@breatheoutbreathe.in To: Eshel Yaron Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 03 20:47:13 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 1saJma-0006mO-Ni for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 03 Aug 2024 20:47:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1saJmK-0007tK-Fy; Sat, 03 Aug 2024 14:46:56 -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 1saJmB-0007sj-4D for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2024 14:46:50 -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 1saJm6-0000Cn-GB for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2024 14:46:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=d+7+qpgEgVGeZkahdTB4hUfhocS9CkTSKs9tDn/Zxgg=; b=QsV9esUMMYGF/6w7K91wVOYyX4qvLeS/7CSCs9XbB96JvEN4IVpQ9aundGCjNSz+HNLms4Ml7ACWuaLmKXs2Dypnp7XPqC5mItzLwF7qm1SLpK4AIdgj2j3+IrWhRCylBT447FKKcYb5SuxerT0702QgWwVRPHEBtJo5ID2PmGuA0Inu/WFLLLht1vfEMmdprpxFjyPad03QdOd7pyHCcgUOzmZP4mb9JlWL0tUSikOmuG4g9I+8FDzUEcV5kRJmDdDrTiZeLfh02fzpS2rhoIU7fInPAhm6fwnrjsouIHRj2yLJj3frX+ApFlL+2IxANbHswFtrLZTjo3t6rfH3aQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1saJmQ-0000IE-FS for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2024 14:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Aug 2024 18:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72437 X-GNU-PR-Package: emacs Original-Received: via spool by 72437-submit@debbugs.gnu.org id=B72437.17227108141103 (code B ref 72437); Sat, 03 Aug 2024 18:47:02 +0000 Original-Received: (at 72437) by debbugs.gnu.org; 3 Aug 2024 18:46:54 +0000 Original-Received: from localhost ([127.0.0.1]:54803 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1saJmI-0000Hf-4U for submit@debbugs.gnu.org; Sat, 03 Aug 2024 14:46:54 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46664) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1saJmG-0000HP-3x for 72437@debbugs.gnu.org; Sat, 03 Aug 2024 14:46:53 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1saJlq-0000A9-5G; Sat, 03 Aug 2024 14:46:26 -0400 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=d+7+qpgEgVGeZkahdTB4hUfhocS9CkTSKs9tDn/Zxgg=; b=SoNhynSfa8AW OTLKU5W69tq1RwP2mlIDPwEqQee7dfCECb9PX5D3n4nmaCHp4PpYJv5UOIQFrM/D/xi+gq9KFN7/1 QSMHQ4DqkIEbRf+dNuuN3uIjNkxNB/wApo7twOUqURPwzvQWFpmLWnuR0zpRWatziAtJnZPTU6qi2 lDaBRcMVwXlV1uC7QwCG+N/MGRwxkOSFdpAcFSaL5l/pD/ehEjJdj92mai1ALrP5iGY5AZYqE4qve ksrF41IIzChCvBiZDU/61Io8vj03VlBPRbjvt7iT26A4V4MEGM900IUzIWhGbn2hawYnyNOf+5wvV TC75sdJZ1jpPIzF0mbErDw==; In-Reply-To: (message from Eshel Yaron on Sat, 03 Aug 2024 20:18:06 +0200) 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:289694 Archived-At: > From: Eshel Yaron > Cc: joseph@breatheoutbreathe.in, monnier@iro.umontreal.ca, > 72437@debbugs.gnu.org > Date: Sat, 03 Aug 2024 20:18:06 +0200 > > >> I'm no Stefan, but I took a quick stab at it. The following diff > >> teaches electric-pair-mode about numeric prefix arguments: > > > > Thanks, but isn't it cleaner if we simply call the hook from cmds.c > > the same number of times as we insert a character? > > Interesting, it might work for electric-pair-mode, though I suspect that > not all functions that people put on post-self-insert-hook are prepared > to be invoked repeatedly following a single self-insert-command. It isn't a single self-insert-command, since it inserts N characters. So it is natural to expect the hook to be invoked those same N times. I think. Let's hear what Stefan thinks (and anyone else who has an opinion or some case other than electric-pair-mode).