This is the general syntax of a type specification:
name ::= (name [keyword argument]... args) | name
Where, name is a widget name, keyword is the name of a property, argument is the value of the property, and args are interpreted in a widget specific way.
The following keyword arguments apply to all widgets:
The initial value for widgets of this type.
This string will be inserted in the buffer when you create a widget. The following ‘%’ escapes are available:
The text inside will be marked as a button.
By default, the text will be shown in
surrounded by brackets.
String to prefix buttons.
String to suffix buttons.
The text inside will be displayed with the face specified by
This will be replaced with the buffer representation of the widget’s value. What this is depends on the widget type.
Warning: In an
editable-field widget, the ‘%v’ escape
must be preceded by some other text in the format string (if specified).
Insert the string specified by
Like ‘%d’, with the following modifications: If the documentation
string is more than one line, it will add a button which will toggle
between showing only the first line, and showing the full text.
Furthermore, if there is no
:doc property in the widget, it will
instead examine the
:documentation-property property. If it is a
lambda expression, it will be called with the widget’s value as an
argument, and the result will be used as the documentation text.
Insert the string specified by
:tag here, or the
representation of the value if there is no tag.
Insert a literal ‘%’.
Face used to highlight text inside %[ %] in the format.
Text around %[ %] in the format.
These can be
No text is inserted.
The string is inserted literally.
The value of the symbol is expanded according to this table.
The string inserted by the ‘%d’ escape in the format string.
The string inserted by the ‘%t’ escape in the format string.
Name of image to use instead of the string specified by
Emacsen that supports it.
Specifies how to display a message whenever you move to the widget with
widget-backward or move the mouse
over it (using the standard
help-echo mechanism). The argument
is either a string to display, a function of one argument, the widget,
which should return a string to display, or a form that evaluates to
such a string.
Specifies how to interpret a mouse-1 click on the widget. See Defining Clickable Text in the Emacs Lisp Reference Manual.
An integer indicating the absolute number of spaces to indent children of this widget.
An integer indicating how many extra spaces to add to the widget’s grandchildren compared to this widget.
An integer indicating how many extra spaces to add to the widget’s children compared to this widget.
A function called each time the widget or a nested widget is changed. The function is called with two or three arguments. The first argument is the widget itself, the second argument is the widget that was changed, and the third argument is the event leading to the change, if any.
Tag used in the menu when the widget is used as an option in a
Function used for finding the tag when the widget is used as an option
menu-choice widget. By default, the tag used will be either the
:tag property if present, or the
representation of the
:value property if not.
Should be a function called with two arguments, the widget and a value,
and returning non-
nil if the widget can represent the specified value.
A function which takes a widget as an argument, and returns
if the widget’s current value is valid for the widget. Otherwise it
should return the widget containing the invalid data, and set that
:error property to a string explaining the error.
The following predefined function can be used:
:children of widget must be valid.
Specify the order in which widgets are traversed with
widget-backward. This is only partially
nil, whichever comes first.
The parent of a nested widget (e.g., a
menu-choice item or an
element of a
This keyword is only used for members of a
checklist. The value should be a list of extra keyword
arguments, which will be used when creating the
checkbox associated with this item.
Directory where glyphs are found. Widget will look here for a file with the same name as specified for the image, with either a .xpm (if supported) or .xbm extension.
nil, allow glyphs to appear on displays where they are supported.