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.
This commit is contained in:
Mattias Engdegård 2023-04-24 16:03:47 +02:00
parent 2ef6f943ab
commit 613591f384

View file

@ -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)")