unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: Robert Pluim <rpluim@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: emacs-30 768e92b9c02: Update options that depend on 'which-key-dont-use-unicode'
Date: Mon, 24 Jun 2024 18:49:43 +0000	[thread overview]
Message-ID: <87jzie2n20.fsf@posteo.net> (raw)
In-Reply-To: <871q4mb6w6.fsf@gmail.com> (Robert Pluim's message of "Mon, 24 Jun 2024 19:14:01 +0200")

Robert Pluim <rpluim@gmail.com> writes:

>>>>>> On Mon, 24 Jun 2024 15:01:24 +0000, Philip Kaludercic <philipk@posteo.net> said:
>     >> This commit causes `which-key-separator' and `which-key-ellipsis' to
>     >> be nil for me (after `which-key-mode'). Reverting this commit fixes it.
>
>     Philip> Eh, that might be because `which-key-dont-use-unicode' is being
>     Philip> evaluated before the other two options, but the :set function is giving
>     Philip> them initial values (nil), even though we haven't determined their
>     Philip> default value yet.
>
>     Philip> Does
>
>     Philip> diff --git a/lisp/which-key.el b/lisp/which-key.el
>     Philip> index 91007ce4ada..8b78bfb2576 100644
>     Philip> --- a/lisp/which-key.el
>     Philip> +++ b/lisp/which-key.el
>     Philip> @@ -133,6 +133,7 @@ which-key-dont-use-unicode
>     Philip>           (mapc #'custom-reevaluate-setting
>     Philip>                 '(which-key-separator
>     Philip>                   which-key-ellipsis)))
>     Philip> +  :initialize #'custom-initialize-changed
>     Philip>    :type 'boolean
>     Philip>    :package-version "1.0" :version "30.1")
>  
>
>
>     Philip> make sense?  I am always uncertain which :initialize value to use.
>
> That works for me, although I wonʼt claim to understand why 😀

My reasoning is that this will only run the setter if the value is
/changed/, right?  So if we set `which-key-dont-use-unicode' is set
before we load which-key, then the user option inherits the
configuration and the other two options use the current value to
determine their default value.  If on the other hand we change the user
option after which-key has been loaded, then the custom setter will take
effect, and will re-load the default value, which has previously been
set to the (if ...) expression, as was the case before.

> Robert

-- 
	Philip Kaludercic on peregrine



  reply	other threads:[~2024-06-24 18:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <171921519771.16563.15139426619834982564@vcs2.savannah.gnu.org>
     [not found] ` <20240624074638.294E1C1FB6E@vcs2.savannah.gnu.org>
2024-06-24 14:32   ` emacs-30 768e92b9c02: Update options that depend on 'which-key-dont-use-unicode' Robert Pluim
2024-06-24 15:01     ` Philip Kaludercic
2024-06-24 17:14       ` Robert Pluim
2024-06-24 18:49         ` Philip Kaludercic [this message]
2024-07-11  9:40           ` Robert Pluim
2024-07-12 13:40             ` Philip Kaludercic
2024-07-12 14:38               ` Robert Pluim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87jzie2n20.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=emacs-devel@gnu.org \
    --cc=rpluim@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).