Re: Setting 'which-key-dont-use-unicode'

Philip Kaludercic <[email protected]>
Newsgroups gmane.emacs.help
Message-ID <[email protected]>
Please disregard this message, my inbox was not properly sorted and I
didn't see that I had already responded with almost exactly the same
idea as two years ago...

Philip Kaludercic <[email protected]> writes:

> Justin Burkett <[email protected]> writes:
>
>> Hi,
>>
>> First, don't set which-key-mode as a custom variable. This is a
>> function that should be called after which-key is loaded.
>
> That shouldn't be an issue or discouraged, all minor modes are
> intentionally user options that enable the minor mode when set using
> :custom, setopt, custom-set-variables, etc.
>
>> For your original question, the important thing is that
>> which-key-dont-use-unicode is set before which-key is loaded. (c)
>> definitely won't work for this reason. 
>
> It shouldn't be necessary, or at least that is what the custom setter of
> `which-key-dont-use-unicode' should provide.  And evaluating these
> expressions in order does indicate that this works:
>
>   which-key-dont-use-unicode ;=> t
>   which-key-separator ;=> " : "
>   (setopt which-key-dont-use-unicode nil)
>   which-key-separator ;=> " → "
>   
>
>>                                        The fact that (d) is working,
>> which takes this logic to the extreme, but the others are not suggests
>> that something is causing which-key to load before the variable is
>> set.
>>
>> Combining the two ideas, try
>>
>> (use-package which-key
>>   :custom
>>   (which-key-dont-use-unicode nil)
>>   :config
>>   (which-key-mode t))
>>
>> If that doesn't work, look for another culprit that might be loading
>> which-key (perhaps because it depends on it) earlier.
>>
>> Justin
>>
>> On Sun, Jun 23, 2024 at 5:05 PM Kévin Le Gouguec
>> <[email protected]> wrote:
>>>
>>> Hello!
>>>
>>> Paging help-gnu-emacs before filing a bug because I'm not sure of the
>>> intended behavior.  After seeing 2024-06-18 "Disable usage of unicode
>>> for which-key by default" (cc0a3a5f65b), I promptly went to my .emacs to
>>> opt in to Unicode symbols, and was surprised to meet some resistance.
>>>
>>> In an Emacs built from 2024-06-23 "; Fix typos" (fb11294d415) on the
>>> emacs-30 branch, I tried
>>>
>>>   (a) this .emacs:
>>>
>>>     (use-package which-key
>>>       :custom
>>>       (which-key-dont-use-unicode nil)
>>>       (which-key-mode t))
>>>
>>>   (b) this .emacs:
>>>
>>>     (custom-set-variables
>>>      '(which-key-dont-use-unicode nil)
>>>      '(which-key-mode t))
>>>
>>>   (c) an empty .emacs, then
>>>
>>>     M-x which-key-mode
>>>     M-x toggle-option which-key-dont-use-unicode
>>>
>>>   (d) a combination of this .emacs:
>>>
>>>     (use-package which-key
>>>       :custom
>>>       (which-key-mode t))
>>>
>>>   with this .emacs.d/early-init.el:
>>>
>>>     (setq which-key-dont-use-unicode nil)
>>>
>>> and only attempt (d) yielded which-key messages with '→' instead of ':'
>>> for the separator symbol (resp. '…' instead of '..'  for truncation).
>>>
>>> Wondering if I am doing something wrong (a definite possibility, the
>>> perils of juggling ${HOME}s for repro purposes), if (d) really is the
>>> intended way to effectively unset which-key-dont-use-unicode, or if this
>>> is a potential bug report or feature request?
>
> No, it is not.  I think this sounds like a bug.  Try to reproduce this
> with emacs -Q and perhaps step through the definitions using edebug,
> because as mentioned above, it seems to work for me.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.