GNU bug report logs -
#74511
31.0.50; `dictionary-search-interface' overrides the user's customization of `dictionary-read-word-function'
Previous Next
Reported by: Steven Allen <steven <at> stebalien.com>
Date: Sun, 24 Nov 2024 18:57:01 UTC
Severity: normal
Found in version 31.0.50
Fixed in version 30.1
Done: Eshel Yaron <me <at> eshelyaron.com>
Bug is archived. No further changes may be made.
Full log
Message #29 received at 74511 <at> debbugs.gnu.org (full text, mbox):
Hi,
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Eshel Yaron <me <at> eshelyaron.com>
>> Cc: Eli Zaretskii <eliz <at> gnu.org>, 74511 <at> debbugs.gnu.org
>> Date: Mon, 25 Nov 2024 22:27:57 +0100
>>
>> Steven Allen <steven <at> stebalien.com> writes:
>>
>> > Is adding the following to `dictionary-search-interface' not sufficient?
>> >
>> > :initialize 'custom-initialize-changed
>> >
>> > That would apply the `dictionary-search-interface' setting if and only
>> > if specified by the user while still alowing the user to, e.g., use the
>> > customize interface.
>>
>> Ah yes, seems even better than my patch since it also makes it possible
>> to set dictionary-search-interface before loading dictionary.el, thanks!
>>
>> Eli, does this seem OK for the release branch?
>>
>> diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el
>> index 58c2e9771ba..42fb8c57b40 100644
>> --- a/lisp/net/dictionary.el
>> +++ b/lisp/net/dictionary.el
>> @@ -317,6 +317,7 @@ dictionary-search-interface
>> dictionary-read-dictionary-function)
>> vals))
>> (set-default-toplevel-value symbol value))
>> + :initialize #'custom-initialize-changed
>> :version "30.1")
>
> Don't you mean custom-initialize-set?
No, I don't: custom-initialize-set calls the :set function if the symbol
does not have a default-toplevel-value, which is when the option is
initialized while loading dictionary.el. So using this :initialize
function does not fix the recipe Steve provided in the original post.
> If I'm missing something, please describe what will happen in the
> various scenarios when dictionary-search-interface and the other
> related options are customized, whether by setq or via Custom, and
> when they are not customized the first time dictionary.el is loaded.
> When we understand all the effects of this, we can reason whether the
> change is safe for the emacs-30 branch (which it better be, since
> these options were introduced in Emacs 30, AFAIR).
With custom-initialize-changed we get the following:
- If you customize the other options but not dictionary-search-interface
before loading dictionary.el, then your settings persist (they are not
overridden) after loading dictionary.el. If you later customize
dictionary-search-interface, then it affects does the other options,
as expected.
- If you do customize dictionary-search-interface before loading
dictionary.el, then it does set the other options when you load
dictionary.el, whether or not you've also set the other options (so it
doesn't make sense to customize both dictionary-search-interface and
the other options, you either customize dictionary-search-interface or
individual options).
So AFAICT it's safe in the sense that it facilitates use cases that
currently do not work (customizing the other options before loading
dictionary.el) without prohibiting any existing use case.
Best,
Eshel
This bug report was last modified 211 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.