From: Mattias EngdegÄrd Date: Mon, 24 Apr 2023 14:03:47 +0000 (+0200) Subject: Require custom values of `boolean` type to be nil or t X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=613591f3846405d8b9e54b65951aaddd45369b7b;p=emacs.git 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. --- 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)")