Subject: Unexpected behavior when inserting with prefix arg in electric-pair-mode

From: Joseph Turner <[email-masked]>
Date: Sat, 03 Aug 2024 00:12:33 -0700

Migrated from this thread on the devel mailing list:

https://yhetil.org/emacs-devel/[email-masked]/T/#t

On Emacs 29.4, with emacs -Q

Turn on electric-pair-mode

(electric-pair-mode +1)

Then press "C-2 ("

Expected result:

Either (()) or ()()

Actual result:

(()

I noticed the unexpected behavior when attempting to surround some text
with multiple braces in order to create Anki flashcards.

More or less, I wanted to go from "foo" to "{{foo}}", and I thought
perhaps that with the whole word selected, pressing "C-2 {" would DTRT.

In general, I'm not sure whether "{}{}" or "{{}}"is more useful or
expected, but I suspect both are better than "{{}".

Thank you!

Joseph