From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#72437: Unexpected behavior when inserting with prefix arg in electric-pair-mode Date: Sat, 03 Aug 2024 20:18:06 +0200 Message-ID: References: <87le1edqqm.fsf@breatheoutbreathe.in> <86h6c2ug0p.fsf@gnu.org> <86a5htvclm.fsf@gnu.org> Reply-To: Eshel Yaron Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6786"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 72437@debbugs.gnu.org, monnier@iro.umontreal.ca, joseph@breatheoutbreathe.in To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 03 20:19:05 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 1saJLM-0001aW-Az for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 03 Aug 2024 20:19:04 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1saJL2-0004vC-Kx; Sat, 03 Aug 2024 14:18:44 -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 1saJL1-0004v2-7x for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2024 14:18: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 1saJL0-0007gk-Uc for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2024 14:18:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=m0lLwQA3WI9JoYp42Bqv92QMiBdS2K73M2Sp/trl1Mc=; b=cGYbKkn4qr6zuln17Z76xO+WVJ5gVQAQhSeZhHn6EuqfZrvHb40atOacEX3+WVNcnTve9D1qv1fRzB0WOPo4rp7dCZx3vLeRytIg4jM+llEuAdvCQNBSQQaHFGA3V+ikoSxa53XDKwRs7RG8PSyNhL5XZHtoLmOIYXVwoKeiha7YobBZrA7Mviwh9Gi7L7JIrvzjo88W32JP1pF6TinKLQMGJQJ/77gCqXBK5Acmw1jeqfVD1Yq9ZsdiplxJpGOOigN5ynAcJRlQAPn/Y53rXIhY0SYRIYPeGkw6UZcFrwjvAxm8YJk7aFMVtd830E3swPXc4JQaXMnioGdoIGfmzQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1saJLJ-0007NA-Qk for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2024 14:19:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Aug 2024 18:19: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.172270911428256 (code B ref 72437); Sat, 03 Aug 2024 18:19:01 +0000 Original-Received: (at 72437) by debbugs.gnu.org; 3 Aug 2024 18:18:34 +0000 Original-Received: from localhost ([127.0.0.1]:54779 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1saJKr-0007Lg-Q0 for submit@debbugs.gnu.org; Sat, 03 Aug 2024 14:18:34 -0400 Original-Received: from mail.eshelyaron.com ([107.175.124.16]:48274 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1saJKo-0007LL-1C for 72437@debbugs.gnu.org; Sat, 03 Aug 2024 14:18:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1722709089; bh=LwlKPkBzqqhFHHYjjGUWMM+/b35JW1KSw7Mfr5wdAI0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=k0NpXtJxv/Qg9Ktd/tsd0Aew8l+32YblVMZjtJuJSllOne8pvHxxqCAanQUtzIGwf ybMRovhrxAtI5OqN2cUJXkMYS4KnX7Xv5g7LU+b+nNAmOtJWwA51EkwypxYbjdfFgX yc1kkyz08ov1kKuuI5RjvMh7nJgdmw6E9k8x5jIYGtzvmHeng+kCs4N9+Cqa1RKfvE 3/ZTsi1hNumw5UbHDZAoiqB6FEpxI4F/XCWZidAnMXZYqMMFuDXEkem8+OdzYfbWey xTtP0Lp8vPygFGS+tfk/Q3sDLblfq+1qOXmpH6XJSLxC49AaRKOIBDdJXmjEziJd2u rtg1jFBy6ByBQ== In-Reply-To: <86a5htvclm.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 03 Aug 2024 18:40:37 +0300") 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:289692 Archived-At: Hi Eli, Eli Zaretskii writes: >> 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? 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.