]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix custom-initialize-reset bootstrap error
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 5 Jul 2022 20:42:25 +0000 (22:42 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 5 Jul 2022 20:42:25 +0000 (22:42 +0200)
* lisp/custom.el (custom-initialize-reset): Fix bootstrap problem
by avoiding when-let.

lisp/custom.el

index a6e2ab351d4fd36b373a0d357ea9953465458571..bbbe70c5ea86cd2a93fa6771fd71ac65d9c07bf9 100644 (file)
@@ -93,13 +93,17 @@ or (last of all) the value of EXP."
   ;; If this value has been set with `setopt' (for instance in
   ;; ~/.emacs), we didn't necessarily know the type of the user option
   ;; then.  So check now, and issue a warning if it's wrong.
-  (when-let ((value (get symbol 'custom-check-value))
-             (type (get symbol 'custom-type)))
-    (when (and (boundp symbol)
-               (eq (car value) (symbol-value symbol))
-               ;; Check that the type is correct.
-               (not (widget-apply (widget-convert type) :match (car value))))
-      (warn "Value `%S' for `%s' does not match type %s" value symbol type)))
+  (let ((value (get symbol 'custom-check-value)))
+    (when value
+      (let ((type (get symbol 'custom-type)))
+        (when (and type
+                   (boundp symbol)
+                   (eq (car value) (symbol-value symbol))
+                   ;; Check that the type is correct.
+                   (not (widget-apply (widget-convert type)
+                                      :match (car value))))
+          (warn "Value `%S' for `%s' does not match type %s"
+                value symbol type)))))
   (funcall (or (get symbol 'custom-set) #'set-default-toplevel-value)
            symbol
            (condition-case nil