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 18:40:37 +0300 Message-ID: <86a5htvclm.fsf@gnu.org> References: <87le1edqqm.fsf@breatheoutbreathe.in> <86h6c2ug0p.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12662"; 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 17:41:51 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 1saGtC-00037p-Jh for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 03 Aug 2024 17:41:50 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1saGt7-0000KD-Uk; Sat, 03 Aug 2024 11:41:45 -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 1saGt4-0000Jk-Du for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2024 11:41:43 -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 1saGt4-0002kC-52 for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2024 11:41:42 -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=xApMHYpTPtx6PMb1G9AvOwnirLnvxdVx0yPuI6YytNA=; b=r1GXEtwRL7+Da3Wx+24PSlwvAVR9K6RIMD0cHxjiTM4uAFm8N+JiN37gCRzwAEUdVYYEMHiFSrUQ4+N4g7dMhTRSHOq/fORXKhtwb0++ExAhbZNG3MOBt76b8hklMKY4i+16XBz8xwnIkmRAG9TqUZirauKT6UbRk2rRuDSJ7hsNsKxJtklLSD5eC1Xoc8i9NyOmiticGlw5wguV8X5o45U5IhJvQl4yJVhReQFaAlCtJS0NvwXaCMC55B+Lb1gNSJkIdmPyxpYlG5zFD8ktTywc9emji3IH2wNx8J5RrRL+VAi0lBHIiIL1xzrVInKTd5u/gz7Om+pwJjjV7nBEEw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1saGtN-00007j-Mn for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2024 11:42:01 -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 15:42:01 +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.1722699670416 (code B ref 72437); Sat, 03 Aug 2024 15:42:01 +0000 Original-Received: (at 72437) by debbugs.gnu.org; 3 Aug 2024 15:41:10 +0000 Original-Received: from localhost ([127.0.0.1]:54706 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1saGsY-00006e-BO for submit@debbugs.gnu.org; Sat, 03 Aug 2024 11:41:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55536) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1saGsV-00006O-4s for 72437@debbugs.gnu.org; Sat, 03 Aug 2024 11:41:08 -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 1saGs5-0002BU-7L; Sat, 03 Aug 2024 11:40:41 -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=xApMHYpTPtx6PMb1G9AvOwnirLnvxdVx0yPuI6YytNA=; b=BxMHuJCXmFvY 2o5vxQGzYTk1Y4+wExwaTyt0N00x+d8AbnPVm609delBS/Hbp8vX55ELhV9Yfla1iVGQpBWKcCx1Z aOMpO/oXTqUvJhEL1lVvJau/ylpAOmXTKyy+wFz4bpgnEmy8guUGLwxJtpiwU+lKE5Rn7TgwKhapp 2kPK5IXQ+tQ2NC3p7ettKqcCduEThYJ44bJzb4m8FnyPVohJmCv0ktqCDcHAfbVvP2lMOZD4a/15w YGm0wYh9G9Cry2wH2gpWsMDN1N5jXO2h2sD5hWg5l3HfT9epky7krTR7TbCWhgFhjPCjNd5WuDXBX GQ2ZC79uQV3xbXu/QLKaPA==; In-Reply-To: (message from Eshel Yaron on Sat, 03 Aug 2024 13:04:58 +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:289682 Archived-At: > From: Eshel Yaron > Cc: Joseph Turner , Stefan Monnier > , 72437@debbugs.gnu.org > Date: Sat, 03 Aug 2024 13:04:58 +0200 > > Eli Zaretskii writes: > > > post-self-insert-hook for each of the ARG inserted characters. OTOH, > > to produce "{{}}" we'd probably need to rewrite the > > electric-pair-mode's hook function, but I have no idea how to rewrite > > it to do that. > > > > Stefan, any suggestions? > > 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?