8.1.2 The item Widget

Syntax:

type ::= (item [keyword argument]... value)

A useful widget that holds a constant value, and can be included in other widgets. Its super is the default widget.

As can be seen in the syntax, the item widget is one of the widget that handles the args argument to widget-create in a specific way. If present, value is used to initialize the :value property. When created, it inserts the value as a string in the buffer.

Example:

(widget-create 'item :tag "Today is" :format "%t: %v\n"
               (format-time-string "%d-%m-%Y"))

By default, it has the following properties:

:convert-widget

The function that allows it to handle value.

:value-create

Prints the representation of :value in the buffer.

:value-get

Returns the value stored in :value.

:match

A value matches the item widget if it’s equal to its :value.

:match-inline

Inline values match the item widget if :value is a sublist of values.

:action

The item widget notifies itself of an event.

:format

By default, the item widget inserts its tag in the buffer.