Fix edge-case with 'which-key-dont-use-unicode' setter
authorPhilip Kaludercic <philipk@posteo.net>
Fri, 26 Jul 2024 21:26:14 +0000 (23:26 +0200)
committerPhilip Kaludercic <philipk@posteo.net>
Fri, 26 Jul 2024 21:26:14 +0000 (23:26 +0200)
* lisp/which-key.el (which-key-dont-use-unicode): Check if the
user options have a 'standard-value' before proceeding to
reevaluate.  This avoids accidentally setting the symbol value
to nil, before the user option has been declared, overriding the
actual non-nil, default values.  (Bug#72077)

lisp/which-key.el

index 37b42a009f736e99614991fb1b7afcd982a3ef74..34de676616f54892f770d110da8d2f13430472bd 100644 (file)
@@ -130,9 +130,10 @@ For affected settings, see `which-key-replacement-alist', `which-key-ellipsis'
 `which-key-separator'."
   :set (lambda (sym val)
          (custom-set-default sym val)
-         (mapc #'custom-reevaluate-setting
-               '(which-key-separator
-                 which-key-ellipsis)))
+         (dolist (sym '(which-key-separator
+                        which-key-ellipsis))
+           (when (get sym 'standard-value)
+             (custom-reevaluate-setting sym))))
   :initialize #'custom-initialize-changed
   :type 'boolean
   :package-version "1.0" :version "30.1")