8.2.1 The Constant Widgets

The const widget can contain any Lisp expression, but the user is prohibited from editing it, which is mainly useful as a component of one of the composite widgets.

The syntax for the const widget is:

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

Its super is the item widget. The value, if present, is used to initialize the :value property and can be any s-expression.

Widget: const

This will display any valid s-expression in an immutable part of the buffer.

It overrides the :prompt-value function, to avoid prompting and just return the widget’s value.

There are two variations of the const widget, namely variable-item and function-item. These should contain a symbol with a variable or function binding, respectively. The major difference from the const widget is that they will allow the user to see the variable or function documentation for the symbol.

This is accomplished via using the ‘%h’ format escape, and adding an appropriate :documentation-property function for each widget.

Widget: variable-item

An immutable symbol that is bound as a variable.

Widget: function-item

An immutable symbol that is bound as a function.