emacs-diffs
[Top][All Lists]
Advanced

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

master 8ccf9b5276: Fix :match function for the key widget


From: Lars Ingebrigtsen
Subject: master 8ccf9b5276: Fix :match function for the key widget
Date: Sat, 19 Feb 2022 07:33:38 -0500 (EST)

branch: master
commit 8ccf9b52767c7634af1941c15198538313aaf2c0
Author: Mauro Aranda <maurooaranda@gmail.com>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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).
---
 lisp/wid-edit.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index f00a524c0c..29b6e13bc6 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)))



reply via email to

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