From 613591f3846405d8b9e54b65951aaddd45369b7b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mattias=20Engdeg=C3=A5rd?= Date: Mon, 24 Apr 2023 16:03:47 +0200 Subject: [PATCH] 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)") -- 2.39.2