* lisp/cus-edit.el (setopt--set): Name the variable in the warning
message. (Bug#73084)
* test/lisp/cus-edit-tests.el (test-setopt): Adjust test.
(cherry picked from commit
2ce0d397b12cafcb3e1ac5630bc3fbca61bd6b87)
;; Check that the type is correct.
(when-let ((type (get variable 'custom-type)))
(unless (widget-apply (widget-convert type) :match value)
- (warn "Value `%S' does not match type %s" value type)))
+ (warn "Value `%S' for variable `%s' does not match its type \"%s\""
+ value variable type)))
(put variable 'custom-check-value (list value))
(funcall (or (get variable 'custom-set) #'set-default) variable value))
(erase-buffer))
(setopt cus-edit-test-foo1 :foo)
(buffer-substring-no-properties (point-min) (point-max)))))
- (should (string-search "Value `:foo' does not match type number"
+ (should (string-search "Value `:foo' for variable `cus-edit-test-foo1' does not match its type \"number\""
warn-txt))))
(defcustom cus-edit-test-bug63290-option nil