Next: , Previous: , Up: The Emacs Widget Library   [Contents][Index]

11 Utilities

Function: widget-prompt-value widget prompt [ value unbound ]

Prompt for a value matching widget, using prompt. The current value is assumed to be value, unless unbound is non-nil.

Function: widget-get-sibling widget

Get the item which widget is assumed to toggle. This is only meaningful for radio buttons or checkboxes in a list.

Function: widget-choose title items &optional event

Prompt the user to choose an item from a list of options.

title is the name of the list of options. items should be a menu, with its items in the simple format or in the extended format. See Defining Menus in the Emacs Lisp Reference Manual. Independently of the format, you don’t have to provide a title for the menu, just pass the desired title in title. The optional event is an input event. If event is a mouse event and the number of elements in items is less than the user option widget-menu-max-size, then widget-choose uses a popup menu to prompt the user. Otherwise, widget-choose uses the minibuffer.

When items is a keymap menu, the returned value is the symbol in the key vector, as in the argument of define-key (see Changing Key Bindings in the Emacs Lisp Reference Manual). When items is a list whose selectable items are of the form (name . value) (i.e., the simplified format), then the return value is the value of the chosen element.

Next: Wishlist, Previous: Widget Minor Mode, Up: The Emacs Widget Library   [Contents][Index]