GNU bug report logs -
#76156
31.0.50; Wrong STATE when customizing allout-command-prefix
Previous Next
Reported by: Mauro Aranda <maurooaranda <at> gmail.com>
Date: Sun, 9 Feb 2025 11:49:02 UTC
Severity: normal
Tags: patch
Found in version 31.0.50
Fixed in version 31.1
Done: Stefan Kangas <stefankangas <at> gmail.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 76156 in the body.
You can then email your comments to 76156 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76156
; Package
emacs
.
(Sun, 09 Feb 2025 11:49:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Mauro Aranda <maurooaranda <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 09 Feb 2025 11:49:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
After emacs -Q:
(require 'allout)
M-x customize-option RET allout-command-prefix
The Customize buffer shows up, with STATE being:
EDITED, shown value does not take effect until you set or save it.
That's wrong, it should say STANDARD.
In GNU Emacs 31.0.50 (build 94, x86_64-pc-linux-gnu, GTK+ Version
3.24.33, cairo version 1.16.0) of 2025-02-09 built on tbb-desktop
Repository revision: 35fa7126903a0ac6a28901d194f0753acf60928d
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12201001
System Description: Ubuntu 22.04.5 LTS
Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM XINERAMA XINPUT2 XPM XRANDR
GTK3 ZLIB
Important settings:
value of $LC_MONETARY: es_AR.UTF-8
value of $LC_NUMERIC: es_AR.UTF-8
value of $LC_TIME: es_AR.UTF-8
value of $LANG: en_US.UTF-8
value of $XMODIFIERS: @im=ibus
locale-coding-system: utf-8-unix
Major mode: Custom
Minor modes in effect:
tooltip-mode: t
global-eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
minibuffer-regexp-mode: t
line-number-mode: t
indent-tabs-mode: t
transient-mark-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
Load-path shadows:
None found.
Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search time-date subr-x mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils tabify
allout thingatpt help-fns byte-opt gv bytecomp byte-compile radix-tree
help-mode cus-edit pp cus-start cus-load icons wid-edit cl-loaddefs
cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd touch-screen tool-bar dnd fontset image regexp-opt
fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode
register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting cairo gtk x-toolkit xinput2 x multi-tty move-toolbar
make-network-process tty-child-frames emacs)
Memory information:
((conses 16 74542 9593) (symbols 48 8266 0) (strings 32 20714 2567)
(string-bytes 1 510475) (vectors 16 13329)
(vector-slots 8 145690 9748) (floats 8 30 19) (intervals 56 351 0)
(buffers 992 13))
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76156
; Package
emacs
.
(Sun, 09 Feb 2025 11:58:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 76156 <at> debbugs.gnu.org (full text, mbox):
Mauro Aranda <maurooaranda <at> gmail.com> writes:
> After emacs -Q:
> (require 'allout)
> M-x customize-option RET allout-command-prefix
>
> The Customize buffer shows up, with STATE being:
> EDITED, shown value does not take effect until you set or save it.
>
> That's wrong, it should say STANDARD.
>
The commit that introduced this is:
commit f7c2fe3337bb5e5721d17f40f79dbc1275e17b0d
Author: Basil L. Contovounesios <basil <at> contovou.net>
Date: Wed Feb 28 16:38:21 2024 +0100
Pacify some docstring control char warnings
Other instances are discussed in the following thread:
https://lists.gnu.org/r/emacs-devel/2024-02/msg00797.html
* lisp/allout.el (allout-command-prefix): Declare :type as
key-sequence. Mark up key sequences in docstring.
The :type was changed from string to key-sequence, but not the value,
and the key-sequence widget requires another format for its value.
Furthermore, the key-sequence widget has been marked as obsolete since
2022.
Because of compatibility, I recommend keeping the :type as string,
since other widgets are more restrictive.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76156
; Package
emacs
.
(Thu, 13 Feb 2025 21:46:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 76156 <at> debbugs.gnu.org (full text, mbox):
Mauro Aranda [2025-02-09 08:57 -0300] wrote:
> Mauro Aranda <maurooaranda <at> gmail.com> writes:
>
>> After emacs -Q:
>> (require 'allout)
>> M-x customize-option RET allout-command-prefix
>>
>> The Customize buffer shows up, with STATE being:
>> EDITED, shown value does not take effect until you set or save it.
>>
>> That's wrong, it should say STANDARD.
Agreed, but this must be common to all key-sequence user options, right?
I see the same state with:
- cua-rectangle-mark-key
- flyspell-auto-correct-binding
- footnote-prefix
- gud-key-prefix
- hide-ifdef-mode-prefix-key
- outline-minor-mode-prefix
- viper-toggle-key
So I think this was a regression somewhere in Emacs 27;
the startup state looks as expected in Emacs versions 24 through 26.
> The commit that introduced this is:
>
> commit f7c2fe3337bb5e5721d17f40f79dbc1275e17b0d
> Author: Basil L. Contovounesios <basil <at> contovou.net>
> Date: Wed Feb 28 16:38:21 2024 +0100
>
> Pacify some docstring control char warnings
>
> Other instances are discussed in the following thread:
> https://lists.gnu.org/r/emacs-devel/2024-02/msg00797.html
>
> * lisp/allout.el (allout-command-prefix): Declare :type as
> key-sequence. Mark up key sequences in docstring.
>
> The :type was changed from string to key-sequence, but not the value,
Yes, I was trying to avoid changing the default value.
> and the key-sequence widget requires another format for its value.
What format is that?
- The manual entry for key-sequence links to
(info "(elisp) Key Sequences") which e.g. includes the text:
‘"\C-xl"’ represents the key sequence ‘C-x l’
according to which I would (and did) interpret "\C-c " as also being a
key sequence.
- widget-key-sequence-validate takes any string or vector.
- widget-key-sequence-value-to-internal delegates to key-description,
which works as desired: (key-description "\C-c ") => "C-c SPC".
- widget-key-sequence-value-to-external via key-parse/read-kbd-macro
drops the trailing space (this surprised me), but this shouldn't give
rise to the current issue, given it behaved the same in Emacs 26, and
also given the other affected user options.
> Furthermore, the key-sequence widget has been marked as obsolete since
> 2022.
Yes, at the time I probably thought that in the future someone would
switch the remaining key-sequence user options to some other default
format, but I didn't want to undertake that :).
> Because of compatibility, I recommend keeping the :type as string,
> since other widgets are more restrictive.
No objections from me, although the UI for strings representing keys
leaves something to be desired :).
Thanks,
--
Basil
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76156
; Package
emacs
.
(Fri, 14 Feb 2025 00:23:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 76156 <at> debbugs.gnu.org (full text, mbox):
"Basil L. Contovounesios" <basil <at> contovou.net> writes:
> Mauro Aranda [2025-02-09 08:57 -0300] wrote:
>
>> Mauro Aranda <maurooaranda <at> gmail.com> writes:
>>
>>> After emacs -Q:
>>> (require 'allout)
>>> M-x customize-option RET allout-command-prefix
>>>
>>> The Customize buffer shows up, with STATE being:
>>> EDITED, shown value does not take effect until you set or save it.
>>>
>>> That's wrong, it should say STANDARD.
>
> Agreed, but this must be common to all key-sequence user options, right?
>
> I see the same state with:
>
> - cua-rectangle-mark-key
> - flyspell-auto-correct-binding
> - footnote-prefix
> - gud-key-prefix
> - hide-ifdef-mode-prefix-key
> - outline-minor-mode-prefix
> - viper-toggle-key
Right. Thanks for finding those.
> So I think this was a regression somewhere in Emacs 27;
> the startup state looks as expected in Emacs versions 24 through 26.
I can't try Emacs 26, sadly. But I take your word. Problem is, with
the widget being obsolete, there's no much incentive to go chasing the
cause, at least for me.
>> The commit that introduced this is:
>>
>> commit f7c2fe3337bb5e5721d17f40f79dbc1275e17b0d
>> Author: Basil L. Contovounesios <basil <at> contovou.net>
>> Date: Wed Feb 28 16:38:21 2024 +0100
>>
>> Pacify some docstring control char warnings
>>
>> Other instances are discussed in the following thread:
>> https://lists.gnu.org/r/emacs-devel/2024-02/msg00797.html
>>
>> * lisp/allout.el (allout-command-prefix): Declare :type as
>> key-sequence. Mark up key sequences in docstring.
>>
>> The :type was changed from string to key-sequence, but not the value,
>
> Yes, I was trying to avoid changing the default value.
>> and the key-sequence widget requires another format for its value.
>
> What format is that?
A vector. This has been the case for quite some time, I think.
> - The manual entry for key-sequence links to
> (info "(elisp) Key Sequences") which e.g. includes the text:
>
> ‘"\C-xl"’ represents the key sequence ‘C-x l’
>
> according to which I would (and did) interpret "\C-c " as also being a
> key sequence.
>
> - widget-key-sequence-validate takes any string or vector.
>
> - widget-key-sequence-value-to-internal delegates to key-description,
> which works as desired: (key-description "\C-c ") => "C-c SPC".
>
> - widget-key-sequence-value-to-external via key-parse/read-kbd-macro
> drops the trailing space (this surprised me), but this shouldn't give
> rise to the current issue, given it behaved the same in Emacs 26, and
> also given the other affected user options.
This is the one that matters. The value is "C-c SPC", and it doesn't
match with [3 32]. But again, no incentive for me to touch that code,
since we should be using either the key widget, or keeping it as a
string.
>> Furthermore, the key-sequence widget has been marked as obsolete since
>> 2022.
>
> Yes, at the time I probably thought that in the future someone would
> switch the remaining key-sequence user options to some other default
> format, but I didn't want to undertake that :).
Understandable :). Maybe I'll give it a shot, but I don't know if it
can be backward compatible.
>> Because of compatibility, I recommend keeping the :type as string,
>> since other widgets are more restrictive.
>
> No objections from me, although the UI for strings representing keys
> leaves something to be desired :).
OK, so I'll try to convert these options to use the key widget.
Thanks for your response.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76156
; Package
emacs
.
(Fri, 14 Feb 2025 12:35:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 76156 <at> debbugs.gnu.org (full text, mbox):
Mauro Aranda [2025-02-13 21:22 -0300] wrote:
> "Basil L. Contovounesios" <basil <at> contovou.net> writes:
>> Mauro Aranda [2025-02-09 08:57 -0300] wrote:
>>> Mauro Aranda <maurooaranda <at> gmail.com> writes:
>>>
>>>> After emacs -Q:
>>>> (require 'allout)
>>>> M-x customize-option RET allout-command-prefix
>>>>
>>>> The Customize buffer shows up, with STATE being:
>>>> EDITED, shown value does not take effect until you set or save it.
>>>>
>>>> That's wrong, it should say STANDARD.
>>
>> Agreed, but this must be common to all key-sequence user options, right?
>>
>> I see the same state with:
>>
>> - cua-rectangle-mark-key
>> - flyspell-auto-correct-binding
>> - footnote-prefix
>> - gud-key-prefix
>> - hide-ifdef-mode-prefix-key
>> - outline-minor-mode-prefix
>> - viper-toggle-key
>
> Right. Thanks for finding those.
>
>> So I think this was a regression somewhere in Emacs 27;
>> the startup state looks as expected in Emacs versions 24 through 26.
>
> I can't try Emacs 26, sadly. But I take your word. Problem is, with
> the widget being obsolete, there's no much incentive to go chasing the
> cause, at least for me.
I asked Git, so you can give me my word back ;).
283fd5f2f6f3fa1f650c5a77f9e3587faddd6881 is the first bad commit
Author: Mauro Aranda <maurooaranda <at> gmail.com>
Date: 2019-09-27 18:06:36 +0200
Don't discard customizations in progress when adding comments (Bug#5358)
The bisect covered emacs-26.3..emacs-27.2. In every step I checked the
state of viper-toggle-key, which has been a vector since 2005, and a
key-sequence since Emacs 25.
Starting with the 'bad' commit, the user option shows up as EDITED in
emacs -Q. This is because default-value returns [(control ?z)], whereas
widget-value returns "^Z" in the function custom-variable-modified-p.
>>> and the key-sequence widget requires another format for its value.
>> What format is that?
> A vector. This has been the case for quite some time, I think.
That makes sense, but unfortunately it wasn't clear to me from its
documentation and usage in the wild.
>> - widget-key-sequence-value-to-external via key-parse/read-kbd-macro
>> drops the trailing space (this surprised me), but this shouldn't give
>> rise to the current issue, given it behaved the same in Emacs 26, and
>> also given the other affected user options.
>
> This is the one that matters. The value is "C-c SPC", and it doesn't
> match with [3 32]. But again, no incentive for me to touch that code,
> since we should be using either the key widget, or keeping it as a
> string.
Right.
Thanks,
--
Basil
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76156
; Package
emacs
.
(Fri, 14 Feb 2025 12:48:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 76156 <at> debbugs.gnu.org (full text, mbox):
"Basil L. Contovounesios" <basil <at> contovou.net> writes:
> Mauro Aranda [2025-02-13 21:22 -0300] wrote:
>
>> "Basil L. Contovounesios" <basil <at> contovou.net> writes:
>>> Mauro Aranda [2025-02-09 08:57 -0300] wrote:
>>>> Mauro Aranda <maurooaranda <at> gmail.com> writes:
>>>>
>>>>> After emacs -Q:
>>>>> (require 'allout)
>>>>> M-x customize-option RET allout-command-prefix
>>>>>
>>>>> The Customize buffer shows up, with STATE being:
>>>>> EDITED, shown value does not take effect until you set or save it.
>>>>>
>>>>> That's wrong, it should say STANDARD.
>>>
>>> Agreed, but this must be common to all key-sequence user options,
right?
>>>
>>> I see the same state with:
>>>
>>> - cua-rectangle-mark-key
>>> - flyspell-auto-correct-binding
>>> - footnote-prefix
>>> - gud-key-prefix
>>> - hide-ifdef-mode-prefix-key
>>> - outline-minor-mode-prefix
>>> - viper-toggle-key
>>
>> Right. Thanks for finding those.
>>
>>> So I think this was a regression somewhere in Emacs 27;
>>> the startup state looks as expected in Emacs versions 24 through 26.
>>
>> I can't try Emacs 26, sadly. But I take your word. Problem is, with
>> the widget being obsolete, there's no much incentive to go chasing the
>> cause, at least for me.
>
> I asked Git, so you can give me my word back ;).
>
> 283fd5f2f6f3fa1f650c5a77f9e3587faddd6881 is the first bad commit
> Author: Mauro Aranda <maurooaranda <at> gmail.com>
> Date: 2019-09-27 18:06:36 +0200
>
> Don't discard customizations in progress when adding comments
(Bug#5358)
>
> The bisect covered emacs-26.3..emacs-27.2. In every step I checked the
> state of viper-toggle-key, which has been a vector since 2005, and a
> key-sequence since Emacs 25.
>
Thanks! I was looking into it, and wasn't sure if that was the culprit
commit.
> Starting with the 'bad' commit, the user option shows up as EDITED in
> emacs -Q. This is because default-value returns [(control ?z)], whereas
> widget-value returns "^Z" in the function custom-variable-modified-p.
Yes. I'm trying to see if calling the :value-to-external on value
is enough, but I think I'm running into the issue you mentioned:
key-parse is dropping the trailing space, so no luck so far.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76156
; Package
emacs
.
(Sat, 15 Feb 2025 12:38:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 76156 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Mauro Aranda <maurooaranda <at> gmail.com> writes:
> "Basil L. Contovounesios" <basil <at> contovou.net> writes:
>
>> Mauro Aranda [2025-02-13 21:22 -0300] wrote:
>>
>>> "Basil L. Contovounesios" <basil <at> contovou.net> writes:
>>>> Mauro Aranda [2025-02-09 08:57 -0300] wrote:
>>>>> Mauro Aranda <maurooaranda <at> gmail.com> writes:
>>>>>
>>>>>> After emacs -Q:
>>>>>> (require 'allout)
>>>>>> M-x customize-option RET allout-command-prefix
>>>>>>
>>>>>> The Customize buffer shows up, with STATE being:
>>>>>> EDITED, shown value does not take effect until you set or save it.
>>>>>>
>>>>>> That's wrong, it should say STANDARD.
>>>>
>>>> Agreed, but this must be common to all key-sequence user options,
> right?
>>>>
>>>> I see the same state with:
>>>>
>>>> - cua-rectangle-mark-key
>>>> - flyspell-auto-correct-binding
>>>> - footnote-prefix
>>>> - gud-key-prefix
>>>> - hide-ifdef-mode-prefix-key
>>>> - outline-minor-mode-prefix
>>>> - viper-toggle-key
>>>
>>> Right. Thanks for finding those.
>>>
>>>> So I think this was a regression somewhere in Emacs 27;
>>>> the startup state looks as expected in Emacs versions 24 through 26.
>>>
>>> I can't try Emacs 26, sadly. But I take your word. Problem is, with
>>> the widget being obsolete, there's no much incentive to go chasing the
>>> cause, at least for me.
>>
>> I asked Git, so you can give me my word back ;).
>>
>> 283fd5f2f6f3fa1f650c5a77f9e3587faddd6881 is the first bad commit
>> Author: Mauro Aranda <maurooaranda <at> gmail.com>
>> Date: 2019-09-27 18:06:36 +0200
>>
>> Don't discard customizations in progress when adding comments
> (Bug#5358)
>>
>> The bisect covered emacs-26.3..emacs-27.2. In every step I checked the
>> state of viper-toggle-key, which has been a vector since 2005, and a
>> key-sequence since Emacs 25.
>>
>
> Thanks! I was looking into it, and wasn't sure if that was the culprit
> commit.
>
>> Starting with the 'bad' commit, the user option shows up as EDITED in
>> emacs -Q. This is because default-value returns [(control ?z)], whereas
>> widget-value returns "^Z" in the function custom-variable-modified-p.
>
> Yes. I'm trying to see if calling the :value-to-external on value
> is enough, but I think I'm running into the issue you mentioned:
> key-parse is dropping the trailing space, so no luck so far.
I came up with a fix for custom-variable-modified-p, in the attached
patch.
With the patch, all of these options show its state as STANDARD, which
is what should happen:
- allout-command-prefix
- cua-rectangle-mark-key
- flyspell-auto-correct-binding
- footnote-prefix
- gud-key-prefix
- hide-ifdef-mode-prefix-key
- outline-minor-mode-prefix
- viper-toggle-key
I've found that converting those to use the key widget instead is
potentially not backward compatible, and introduces too many
complications that I concluded it's not worth it, so I didn't pursue it
anymore.
I've done extensive testing on other types to avoid regressions, and
didn't find any.
[0001-Fix-comparison-of-current-values-for-the-key-sequenc.patch (text/x-patch, attachment)]
Added tag(s) patch.
Request was from
Stefan Kangas <stefankangas <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Sat, 15 Feb 2025 15:43:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#76156
; Package
emacs
.
(Sat, 15 Feb 2025 19:54:02 GMT)
Full text and
rfc822 format available.
Message #28 received at 76156 <at> debbugs.gnu.org (full text, mbox):
Mauro Aranda [2025-02-15 09:37 -0300] wrote:
> I came up with a fix for custom-variable-modified-p, in the attached
> patch.
I haven't tested it, but it LGTM, thanks!
--
Basil
Reply sent
to
Stefan Kangas <stefankangas <at> gmail.com>
:
You have taken responsibility.
(Sun, 23 Feb 2025 00:30:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Mauro Aranda <maurooaranda <at> gmail.com>
:
bug acknowledged by developer.
(Sun, 23 Feb 2025 00:30:02 GMT)
Full text and
rfc822 format available.
Message #33 received at 76156-done <at> debbugs.gnu.org (full text, mbox):
Version: 31.1
"Basil L. Contovounesios" <basil <at> contovou.net> writes:
> Mauro Aranda [2025-02-15 09:37 -0300] wrote:
>
>> I came up with a fix for custom-variable-modified-p, in the attached
>> patch.
>
> I haven't tested it, but it LGTM, thanks!
Thanks, installed on master as commit f549cedaa27.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sun, 23 Mar 2025 11:24:43 GMT)
Full text and
rfc822 format available.
This bug report was last modified 139 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.