Lars Ingebrigtsen <larsi@gnus.org> writes:
> Mauro Aranda <maurooaranda@gmail.com> writes:
>
>> I think it makes sense to expand the impact of :must-match t to
>> Customization buffers, like in the attached patch.
>
> [...]
>
>> + :match #'(lambda (widget value)
>> + (or (not (widget-get widget :must-match))
>> + (file-exists-p value)))
>
> Makes sense to me. I've now applied this to Emacs 28 (but I removed the
> #''s before the lambdas first (they're superfluous)).
I found that the :match function will return false positives when
:must-match is nil and value is not a string. This can happen is
the defcustom is of type:
:type '(choice file (const nil))), and the value is nil, because we
check if nil matches with the widget file first.
Here's a patch to fix it.