all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eshel Yaron <me@eshelyaron.com>
Cc: 72437@debbugs.gnu.org, eliz@gnu.org, monnier@iro.umontreal.ca
Subject: bug#72437: Unexpected behavior when inserting with prefix arg in electric-pair-mode
Date: Sat, 21 Sep 2024 10:24:57 -0700	[thread overview]
Message-ID: <87o74gsyvq.fsf@breatheoutbreathe.in> (raw)
In-Reply-To: <m1jzf55mpw.fsf@eshelyaron.com> (Eshel Yaron's message of "Sat, 21 Sep 2024 12:23:55 +0200")

[-- Attachment #1: Type: text/plain, Size: 1351 bytes --]

Eshel Yaron <me@eshelyaron.com> writes:

> Joseph Turner <joseph@breatheoutbreathe.in> writes:
>
>> Joseph Turner <joseph@breatheoutbreathe.in> writes:
>>
>>> On August 13, 2024 10:07:23 PM PDT, Eshel Yaron <me@eshelyaron.com> wrote:
>>>>Hi Stefan,
>>>>
>>>>Stefan Monnier writes:
>>>>
>>>>>> Let's hear what Stefan thinks (and anyone else who has an
>>>>>> opinion or some case other than electric-pair-mode).
>>>>>
>>>>> I think the requested behavior makes a lot of sense, but I lost touch
>>>>> with the way elec-pair works and interacts with other electric modes, so
>>>>> I'm not sure how to make it work without breaking other things.
>>>>
>>>>In case you missed it, the patch I shared upthread might give you
>>>>some ideas.  It implements the requested behavior, safely, I think.
>>>>So I would just ask Joseph to try it out for a while and see if it
>>>>works as expected and if any other issues crop up :)
>>>
>>> Thanks for this patch!  I am testing it in my daily config.  So far
>>> so good, and I'll report back after a few weeks of usage.
>>
>> I have been running this patch for over a month with no issue.
>
> That's great, thanks for testing it and for reporting back!
>
>> I vote to merge it!
>
> Agreed.  Here's a full patch with tests, doc updates and a NEWS entry:

Nice!  How about also adding a test like the attached patch?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Test-behavior-with-prefix-argument.patch --]
[-- Type: text/x-diff, Size: 957 bytes --]

From 414a4b1fa09b0b976e74144430871b1b5a9ddbbe Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Sat, 21 Sep 2024 10:23:07 -0700
Subject: [PATCH] Test behavior with prefix argument

* test/lisp/electric-tests.el (electric-pair-backspace-2)
---
 test/lisp/electric-tests.el | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/test/lisp/electric-tests.el b/test/lisp/electric-tests.el
index 720313511a6..f1742fe3f0b 100644
--- a/test/lisp/electric-tests.el
+++ b/test/lisp/electric-tests.el
@@ -562,6 +562,14 @@ electric-pair-backspace-1
       (electric-pair-delete-pair 1)
       (should (equal "" (buffer-string))))))
 
+(ert-deftest electric-pair-backspace-2 ()
+  (save-electric-modes
+   (with-temp-buffer
+     (insert "((()))")
+     (goto-char 4)
+     (electric-pair-delete-pair 2)
+     (should (equal "()" (buffer-string))))))
+
 \f
 ;;; Undoing
 (ert-deftest electric-pair-undo-unrelated-state ()
-- 
2.46.0


  reply	other threads:[~2024-09-21 17:24 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-03  7:12 bug#72437: Unexpected behavior when inserting with prefix arg in electric-pair-mode Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-03  9:12 ` Eli Zaretskii
2024-08-03 11:04   ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-03 15:40     ` Eli Zaretskii
2024-08-03 18:18       ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-03 18:46         ` Eli Zaretskii
2024-08-14  1:00           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-14  5:07             ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-14 11:39               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-17  6:28               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-19  5:14                 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-21 10:23                   ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-21 17:24                     ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-09-22  8:21                       ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-22 19:32                         ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-14  0:57   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-16 21:22     ` João Távora
2024-08-17  6:08       ` Eli Zaretskii
2024-08-17  9:30         ` João Távora
2024-08-17 14:03         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-17 14:21           ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o74gsyvq.fsf@breatheoutbreathe.in \
    --to=bug-gnu-emacs@gnu.org \
    --cc=72437@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=joseph@breatheoutbreathe.in \
    --cc=me@eshelyaron.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.