1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-03 11:33:37 +00:00

Fix :match function for the file widget

* lisp/wid-edit.el (file widget): Return nil if value is not a
string (bug#25678).
This commit is contained in:
Mauro Aranda 2020-09-10 15:12:50 +02:00 committed by Lars Ingebrigtsen
parent 5d522b430b
commit c033bb8648

View File

@ -3162,8 +3162,9 @@ It reads a file name from an editable text field."
#'completion-file-name-table
(not read-file-name-completion-ignore-case))
:match (lambda (widget value)
(or (not (widget-get widget :must-match))
(file-exists-p value)))
(and (stringp value)
(or (not (widget-get widget :must-match))
(file-exists-p value))))
:validate (lambda (widget)
(let ((value (widget-value widget)))
(unless (widget-apply widget :match value)