;; 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