From 1fe269d59df02b398d6240385bc1861568b97868 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 5 Jul 2022 22:42:25 +0200 Subject: [PATCH] Fix custom-initialize-reset bootstrap error * lisp/custom.el (custom-initialize-reset): Fix bootstrap problem by avoiding when-let. --- lisp/custom.el | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lisp/custom.el b/lisp/custom.el index a6e2ab351d4..bbbe70c5ea8 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -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 -- 2.30.2