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 #20 received at 74511 <at> debbugs.gnu.org (full text, mbox):
Eshel Yaron <me <at> eshelyaron.com> writes:
> Hi,
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>>> From: Steven Allen <steven <at> stebalien.com>
>>> Cc: 74511 <at> debbugs.gnu.org
>>> Date: Sun, 24 Nov 2024 12:36:00 -0800
>>>
>>> Eli Zaretskii <eliz <at> gnu.org> writes:
>>>
>>> >> Date: Sun, 24 Nov 2024 10:56:08 -0800
>>> >> From: Steven Allen via "Bug reports for GNU Emacs,
>>> >> the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>>> >>
>>> >>
>>> >> If the user customizes `dictionary-read-word-function' then loads the
>>> >> dictionary package, the value of `dictionary-read-word-function' will be
>>> >> overridden when `dictionary-search-interface' is loaded. To reproduce:
>>> >>
>>> >> 1. Run emacs with `emacs -Q`.
>>> >> 2. Open a scratch buffer and evaluate the following:
>>> >>
>>> >> (setopt dictionary-read-word-function 'dictionary-completing-read-word)
>>> >> (require 'dictionary)
>>> >> (message "%S" dictionary-read-word-function)
>>> >>
>>> >> I'd expect `dictionary-read-word-function' to be
>>> >> `dictionary-completing-read-word' but instead it gets reset back to the
>>> >> default, `dictionary-read-dictionary-default'. I can work around this by
>>> >> calling `setopt' after loading the `dictionary' package, but ideally
>>> >> that wouldn't be necessary.
>>> >
>>> > You are supposed to customize dictionary-search-interface if you want
>>> > this mode of operation.
>>>
>>> In addition to dictionary-search-interface, there are three separately
>>> customizable variables:
>>>
>>> - dictionary-display-definition-function
>>> - dictionary-read-word-function
>>> - dictionary-read-dictionary-function
>>>
>>> I'd expect dictionary-search-interface to override the defaults for
>>> these variables, but I wouldn't expect it to completely clobber any user
>>> customizations of said variables.
>>>
>>> If these variables cannot be customized, I'd expect them to be "defvar"
>>> not "defcustom". Although that would be rather unfortunate because,
>>> while I want to enable minibuffer completion for words/dictionaries, I'd
>>> also like to use the real dictionary mode (not the help buffer).
>>>
>>> Adding ":initialize 'custom-initialize-changed" to
>>> dictionary-search-interface would make it possible to specify either
>>> dictionary-search-interface or any of the other variables (but not both
>>> at the same time).
>>
>> Eshel, would you please look into this? IMO, we should at least
>> improve the documentation to clarify these subtleties. Bonus points
>> for allowing users to customize the other options without clobbering
>> them when the package is loaded or dictionary-search-interface is
>> customized.
>
> Thank you Steven, for reporting this issue, and Eli, for pinging me.
>
> The patch below tries to do both:
>
> - it adds a few words to the docstring of dictionary-search-interface
> which explain that this option can only be meaningfully set after
> loading dictionary.el, and
> - it avoids clobbering existing settings for the other options during
> initialization. It still overrides existing settings for the other
> options if you set dictionary-search-interface after dictionary.el,
> because that's the intended behavior when customizing this option.
>
> WDYT?
>
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.
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.