emacs-diffs
[Top][All Lists]
Advanced

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

master 613591f3846 1/2: Require custom values of `boolean` type to be ni


From: Mattias Engdegård
Subject: master 613591f3846 1/2: Require custom values of `boolean` type to be nil or t
Date: Mon, 24 Apr 2023 10:07:19 -0400 (EDT)

branch: master
commit 613591f3846405d8b9e54b65951aaddd45369b7b
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    Require custom values of `boolean` type to be nil or t
    
    This helps detecting mistakes in types and/or initial values.
    
    * lisp/wid-edit.el (boolean): Add :match function.
---
 lisp/wid-edit.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index 60bd2baa6fb..8b035224c9b 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -4038,6 +4038,7 @@ is inline."
   :button-prefix 'widget-push-button-prefix
   :button-suffix 'widget-push-button-suffix
   :format "%{%t%}: %[Toggle%]  %v\n"
+  :match (lambda (_widget value) (booleanp value))
   :on "on (non-nil)"
   :off "off (nil)")
 



reply via email to

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