unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* With electric-pair-mode, N prefix arg should insert N balanced pairs
@ 2024-08-03  5:49 Joseph Turner
  2024-08-03  6:41 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Joseph Turner @ 2024-08-03  5:49 UTC (permalink / raw)
  To: Emacs Devel Mailing List

On Emacs 29.4, with emacs -Q

Turn on electric-pair-mode

(electric-pair-mode +1)

Then press "C-2 ("

Expected result:

(())

Actual result:

(()

Thank you!

Joseph



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: With electric-pair-mode, N prefix arg should insert N balanced pairs
  2024-08-03  5:49 With electric-pair-mode, N prefix arg should insert N balanced pairs Joseph Turner
@ 2024-08-03  6:41 ` Eli Zaretskii
  2024-08-03  7:07   ` Joseph Turner
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2024-08-03  6:41 UTC (permalink / raw)
  To: Joseph Turner; +Cc: emacs-devel

> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Date: Fri, 02 Aug 2024 22:49:17 -0700
> 
> On Emacs 29.4, with emacs -Q
> 
> Turn on electric-pair-mode
> 
> (electric-pair-mode +1)
> 
> Then press "C-2 ("
> 
> Expected result:
> 
> (())
> 
> Actual result:
> 
> (()

Thanks, but why do you expect "(())" rather than "()()"?  Electric
Pair mode works per inserted character, and doesn't know anything
about nesting.

In any case, this should have been submitted as a bug report, and go
to the bug tracker, not posted here.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: With electric-pair-mode, N prefix arg should insert N balanced pairs
  2024-08-03  6:41 ` Eli Zaretskii
@ 2024-08-03  7:07   ` Joseph Turner
  0 siblings, 0 replies; 3+ messages in thread
From: Joseph Turner @ 2024-08-03  7:07 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>> Date: Fri, 02 Aug 2024 22:49:17 -0700

[...]

> Thanks, but why do you expect "(())" rather than "()()"?  Electric
> Pair mode works per inserted character, and doesn't know anything
> about nesting.

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 "{{}".

> In any case, this should have been submitted as a bug report, and go
> to the bug tracker, not posted here.

You're right.  I'll repost on the bug tracker.

Thank you!

Joseph



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-03  7:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-03  5:49 With electric-pair-mode, N prefix arg should insert N balanced pairs Joseph Turner
2024-08-03  6:41 ` Eli Zaretskii
2024-08-03  7:07   ` Joseph Turner

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).