-VALUE is validated against SYMBOL's custom type."
- `(if (boundp ',symbol)
- (setq ,symbol (validate-value ,value (custom-variable-type ',symbol)))
- (user-error "Trying to validate a variable that's not defined yet: `%s'.\nYou need to require the package before validating"
- ',symbol)))
+VALUE is validated against SYMBOL's custom type.
+
+\(fn [SYM VAL] ...)"
+ (let ((out))
+ (while svs
+ (let ((symbol (pop svs))
+ (value (if (not svs)
+ (error "`validate-setq' takes an even number of arguments")
+ (pop svs))))
+ (push `(if (boundp ',symbol)
+ (setq ,symbol (validate-value ,value (custom-variable-type ',symbol)))
+ (user-error "Trying to validate a variable that's not defined yet: `%s'.\nYou need to require the package before validating"
+ ',symbol))
+ out)))
+ `(progn ,@(reverse out))))