From: Mauro Aranda Date: Sat, 19 Feb 2022 12:33:05 +0000 (+0100) Subject: Fix :match function for the key widget X-Git-Tag: emacs-29.0.90~2232 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8ccf9b52767c7634af1941c15198538313aaf2c0;p=emacs.git Fix :match function for the key widget * lisp/wid-edit.el (key): Calling key-valid-p directly doesn't work, because the :match function is called with the widget and the value as arguments (bug#54049). --- diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index f00a524c0c4..29b6e13bc60 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -3532,13 +3532,17 @@ It reads a directory name from an editable text field." (define-widget 'key 'editable-field "A key sequence." :prompt-value 'widget-field-prompt-value - :match 'key-valid-p + :match #'widget-key-valid-p :format "%{%t%}: %v" :validate 'widget-key-validate :keymap widget-key-sequence-map :help-echo "C-q: insert KEY, EVENT, or CODE; RET: enter value" :tag "Key") +(defun widget-key-valid-p (_widget value) + "Non-nil if VALUE is a valid value for the key widget WIDGET." + (key-valid-p value)) + (defun widget-key-validate (widget) (unless (and (stringp (widget-value widget)) (key-valid-p (widget-value widget)))