bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#25678: 25.1; defcustom type `(file :must-match t)' seems not to work


From: Mauro Aranda
Subject: bug#25678: 25.1; defcustom type `(file :must-match t)' seems not to work
Date: Wed, 9 Sep 2020 14:21:11 -0300

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.


Attachment: 0001-Fix-match-function-for-the-file-widget.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]