Next: Defining New Types, Previous: Splicing into Lists, Up: Customization Types
You can specify keyword-argument pairs in a customization type after the type name symbol. Here are the keywords you can use, and their meanings:
:value
defaultIf nil
is not a valid value for the alternative, then it is
essential to specify a valid default with :value
.
If you use this for a type that appears as an alternative inside of
choice
; it specifies the default value to use, at first, if and
when the user selects this alternative with the menu in the
customization buffer.
Of course, if the actual value of the option fits this alternative, it
will appear showing the actual value, not default.
:format
format-string:action
attribute specifies what the button will do if the user invokes it;
its value is a function which takes two arguments—the widget which
the button appears in, and the event.
There is no way to specify two different buttons with different
actions.
:sample-face
.
:tag
keyword.
:action
action:button-face
face:button-prefix
prefix:button-suffix
suffixnil
:tag
tag:doc
doc:format
, and use ‘%d’ or ‘%h’
in that value.
The usual reason to specify a documentation string for a type is to
provide more information about the meanings of alternatives inside a
:choice
type or the parts of some other composite type.
:help-echo
motion-docwidget-forward
or
widget-backward
, it will display the string motion-doc in
the echo area. In addition, motion-doc is used as the mouse
help-echo
string and may actually be a function or form evaluated
to yield a help string. If it is a function, it is called with one
argument, the widget.
:match
functionnil
if
the value is acceptable.
:validate
functionnil
if the widget's
current value is valid for the widget. Otherwise, it should return
the widget containing the invalid data, and set that widget's
:error
property to a string explaining the error.