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

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

bug#65625: 30.0.50; electric-pair-skip-whitespace-chars choice looks wro


From: Mauro Aranda
Subject: bug#65625: 30.0.50; electric-pair-skip-whitespace-chars choice looks wrong
Date: Wed, 30 Aug 2023 19:48:24 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

Stefan Kangas <stefankangas@gmail.com> writes:

>> Looking at the electric-pair-skip-whitespace-chars defcustom:
>>
>> (defcustom electric-pair-skip-whitespace-chars (list ?\t ?\s ?\n)
>>    "Whitespace characters considered by `electric-pair-skip-whitespace'."
>>    :version "24.4"
>>    :group 'electricity
>>    :type '(choice (set (const :tag "Space" ?\s)
>>                        (const :tag "Tab" ?\t)
>>                        (const :tag "Newline" ?\n))
>>                   (list character)))
>>
>> I think the 2nd choice should be (repeat character) rather than
>> (list character).
>
> With `list' I get this:
>
> Hide Electric Pair Skip Whitespace Chars: Choice: Value Menu List:
> Character: ^@
>     State : EDITED, shown value does not take effect until you set or save it.
>    Whitespace characters considered by ‘electric-pair-skip-whitespace’.
> Groups: Electricity
>
> And with `repeat', I get this:
>
> Hide Electric Pair Skip Whitespace Chars: Choice: Value Menu Repeat:
> INS
>     State : EDITED, shown value does not take effect until you set or save it.
>    Whitespace characters considered by ‘electric-pair-skip-whitespace’.
> Groups: Electricity
>
> If I now hit "INS", I see this:
>
> Hide Electric Pair Skip Whitespace Chars: Choice: Value Menu Repeat:
> INS DEL Character: ^@
> INS
>     State : EDITED, shown value does not take effect until you set or save it.
>    Whitespace characters considered by ‘electric-pair-skip-whitespace’.
> Groups: Electricity
>
> And then when I try to delete "^@" to edit it, it changes to "\s", and
> then I can't delete it to enter something else.  So this all seems
> pretty wonky to me.  Is `repeat' that much of an improvement?

The character widget might be wonky, but that shouldn't matter when
choosing between list or repeat.  You would have observed the same
behavior if the character widget were part of the list widget (delete
"^@" to edit it, changes to "\s", then hitting C-d looks like it does
nothing).

What's important here is that the 2nd choice lets the user choose only
one whitespace character, while it seems pretty clear to me
that the intention was for the user to be able to customize it to a list
of whitespace characters, not just to a list of one.  And that's what
the repeat widget is for, so yes, it is a real improvement.

I attach a patch.

Attachment: 0001-Fix-choice-in-electric-pair-skip-whitespace-chars.patch
Description: Text Data


reply via email to

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