bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#23298: 25.0.92; electric-pair-delete-pair doesn't check if parens ar


From: Stefan Kangas
Subject: bug#23298: 25.0.92; electric-pair-delete-pair doesn't check if parens are balanced
Date: Tue, 11 Aug 2020 19:52:12 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Mohammed Sadik <sadiq@sadiqpk.org> writes:
>
>> When pressing Backspace key, with electric-pair-mode enabled,
>> it unconditionally deletes the following char, if its the matching pair.
>> Ideally, it may better check if it breaks the equilibrium of
>> braces/quotes.
>>
>> Eg: code: (char-before (point))
>>                              |_ point location
>> If my point (cursor) is just before the last paren (the cursor is
>> blinking on the last paren), and I press backspace until the beginning
>> of "point"[0], and then one char back[1], it just deletes the bracket,
>> without checking if the parens are balanced.
>>
>> code:
>>         [0] (char-before ()
>>                          |_point location
>>         [1] (char-before
>>                         |_ point location
>>
>> This could be the case of quotes, braces, etc.
>
> (I'm going through old Emacs bug reports that haven't received any
> response.)
>
> Or a simpler example:
>
> (foo ()
>
> If you put point after the next-to-last character, then hitting DEL will
> delete the last pair:
>
> (foo
>
> But...  I don't think this is a bug?  electric-pair-mode doesn't promise
> to keep things balanced globally, but delete the matching pair if you
> delete an opening parenthesis?  I think.
>
> Does that tally with what everybody else would expect?

Do we have any electric-pair-mode users who could comment on this?

Best regards,
Stefan Kangas





reply via email to

[Prev in Thread] Current Thread [Next in Thread]