428
+ − 1 \input texinfo.tex
+ − 2
+ − 3 @c %**start of header
+ − 4 @setfilename ../info/widget.info
+ − 5 @settitle The Emacs Widget Library
+ − 6 @iftex
+ − 7 @afourpaper
+ − 8 @headings double
+ − 9 @end iftex
+ − 10 @c %**end of header
+ − 11
+ − 12 @ifinfo
+ − 13 @dircategory XEmacs Editor
+ − 14 @direntry
440
+ − 15 * Widgets: (widget). The Emacs Widget Library.
428
+ − 16 @end direntry
+ − 17 @end ifinfo
+ − 18
+ − 19 @node Top, Introduction, (dir), (dir)
+ − 20 @comment node-name, next, previous, up
+ − 21 @top The Emacs Widget Library
+ − 22
+ − 23 @menu
+ − 24 * Introduction::
+ − 25 * User Interface::
+ − 26 * Programming Example::
+ − 27 * Setting Up the Buffer::
+ − 28 * Basic Types::
+ − 29 * Sexp Types::
+ − 30 * Widget Properties::
+ − 31 * Defining New Widgets::
+ − 32 * Widget Browser::
+ − 33 * Widget Minor Mode::
+ − 34 * Utilities::
+ − 35 * Widget Wishlist::
1183
+ − 36 * Widget Internals::
428
+ − 37 @end menu
+ − 38
+ − 39 @node Introduction, User Interface, Top, Top
+ − 40 @comment node-name, next, previous, up
+ − 41 @section Introduction
+ − 42
2028
+ − 43 @c XEmacs changes to reflect history, native widgets, and GTK
+ − 44 Most graphical user interface toolkits, since Motif and XView, provide
428
+ − 45 a number of standard user interface controls (sometimes known as
2028
+ − 46 `widgets' or `gadgets'). Historically, Emacs didn't support anything like
+ − 47 this, except for its incredible powerful text ``widget''. However,
+ − 48 since XEmacs 21.4, XEmacs has supported ``native'' widgets (GUI controls
+ − 49 implemented as Lisp APIs in C for the MS Windows, Motif, Athena, and GTK
+ − 50 toolkits) and libglade (GUI controls with an XML API for the GTK
+ − 51 toolkit). On the other hand, Emacs does provide the necessary
+ − 52 primitives to implement many other widgets within a text buffer, and of
+ − 53 course this is the only way to implement self-contained controls in a
+ − 54 text terminal. The @code{widget} package simplifies this task.
428
+ − 55
2028
+ − 56 Examples of some basic widgets include:
428
+ − 57
+ − 58 @table @code
+ − 59 @item link
+ − 60 Areas of text with an associated action. Intended for hypertext links
+ − 61 embedded in text.
+ − 62 @item push-button
+ − 63 Like link, but intended for stand-alone buttons.
+ − 64 @item editable-field
+ − 65 An editable text field. It can be either variable or fixed length.
+ − 66 @item menu-choice
+ − 67 Allows the user to choose one of multiple options from a menu, each
+ − 68 option is itself a widget. Only the selected option will be visible in
+ − 69 the buffer.
+ − 70 @item radio-button-choice
+ − 71 Allows the user to choose one of multiple options by activating radio
+ − 72 buttons. The options are implemented as widgets. All options will be
+ − 73 visible in the buffer.
+ − 74 @item item
+ − 75 A simple constant widget intended to be used in the @code{menu-choice} and
+ − 76 @code{radio-button-choice} widgets.
+ − 77 @item choice-item
901
+ − 78 A button item only intended for use in choices. When invoked, the user
428
+ − 79 will be asked to select another option from the choice widget.
+ − 80 @item toggle
+ − 81 A simple @samp{on}/@samp{off} switch.
+ − 82 @item checkbox
+ − 83 A checkbox (@samp{[ ]}/@samp{[X]}).
+ − 84 @item editable-list
+ − 85 Create an editable list. The user can insert or delete items in the
+ − 86 list. Each list item is itself a widget.
+ − 87 @end table
+ − 88
+ − 89 Now of what possible use can support for widgets be in a text editor?
+ − 90 I'm glad you asked. The answer is that widgets are useful for
2028
+ − 91 implementing forms. A @dfn{form} in Emacs is a buffer where the user is
428
+ − 92 supposed to fill out a number of fields, each of which has a specific
+ − 93 meaning. The user is not supposed to change or delete any of the text
+ − 94 between the fields. Examples of forms in Emacs are the @file{forms}
+ − 95 package (of course), the customize buffers, the mail and news compose
+ − 96 modes, and the @sc{html} form support in the @file{w3} browser.
+ − 97
+ − 98 The advantages for a programmer of using the @code{widget} package to
+ − 99 implement forms are:
+ − 100
+ − 101 @enumerate
+ − 102 @item
444
+ − 103 More complex fields than just editable text are supported.
428
+ − 104 @item
+ − 105 You can give the user immediate feedback if he enters invalid data in a
+ − 106 text field, and sometimes prevent entering invalid data.
+ − 107 @item
2028
+ − 108 You can have fixed sized fields, thus allowing multiple fields to be
428
+ − 109 lined up in columns.
+ − 110 @item
+ − 111 It is simple to query or set the value of a field.
+ − 112 @item
2028
+ − 113 Editing happens in a normal buffer, not in the mini-buffer.
428
+ − 114 @item
2028
+ − 115 Packages using the library get a uniform look-and-feel, making them easier for
428
+ − 116 the user to learn.
+ − 117 @item
2028
+ − 118 As support for embedded graphics has improved, the widget library will
428
+ − 119 extended to support it. This means that your code using the widget
2028
+ − 120 library will also use the new graphic features automatically.
+ − 121 @item
+ − 122 A widget specification is implemented as a class, and new subclasses can
+ − 123 be derived from any class, by restricting or extending the behavior.
428
+ − 124 @end enumerate
+ − 125
+ − 126 In order to minimize the code that is loaded by users who does not
+ − 127 create any widgets, the code has been split in two files:
+ − 128
+ − 129 @table @file
+ − 130 @item widget.el
2028
+ − 131 This declares the user variables, defines the function
+ − 132 @code{define-widget}, and autoloads the function @code{widget-create}.
428
+ − 133 @item wid-edit.el
2028
+ − 134 Everything else is here. Do not load it explicitly, as
428
+ − 135 it will be autoloaded when needed.
+ − 136 @end table
+ − 137
+ − 138 @node User Interface, Programming Example, Introduction, Top
+ − 139 @comment node-name, next, previous, up
+ − 140 @section User Interface
+ − 141
904
+ − 142 A form consists of read only text for documentation and some fields,
+ − 143 where each of the fields contains two parts, a tag and a value. The
+ − 144 tags are used to identify the fields, so the documentation can refer to
+ − 145 the foo field, meaning the field tagged with @samp{Foo}. Here is an
+ − 146 example form:
428
+ − 147
+ − 148 @example
+ − 149 Here is some documentation.
+ − 150
+ − 151 Name: @i{My Name} @strong{Choose}: This option
+ − 152 Address: @i{Some Place
+ − 153 In some City
+ − 154 Some country.}
+ − 155
+ − 156 See also @b{_other work_} for more information.
+ − 157
+ − 158 Numbers: count to three below
+ − 159 @b{[INS]} @b{[DEL]} @i{One}
+ − 160 @b{[INS]} @b{[DEL]} @i{Eh, two?}
+ − 161 @b{[INS]} @b{[DEL]} @i{Five!}
+ − 162 @b{[INS]}
+ − 163
+ − 164 Select multiple:
+ − 165
+ − 166 @b{[X]} This
+ − 167 @b{[ ]} That
+ − 168 @b{[X]} Thus
+ − 169
+ − 170 Select one:
+ − 171
+ − 172 @b{(*)} One
+ − 173 @b{( )} Another One.
+ − 174 @b{( )} A Final One.
+ − 175
+ − 176 @b{[Apply Form]} @b{[Reset Form]}
+ − 177 @end example
+ − 178
2028
+ − 179 The top level widgets in this example are tagged @samp{Name},
428
+ − 180 @samp{Choose}, @samp{Address}, @samp{_other work_}, @samp{Numbers},
+ − 181 @samp{Select multiple}, @samp{Select one}, @samp{[Apply Form]}, and
+ − 182 @samp{[Reset Form]}. There are basically two thing the user can do within
+ − 183 a form, namely editing the editable text fields and activating the
+ − 184 buttons.
+ − 185
+ − 186 @subsection Editable Text Fields
+ − 187
+ − 188 In the example, the value for the @samp{Name} is most likely displayed
+ − 189 in an editable text field, and so are values for each of the members of
+ − 190 the @samp{Numbers} list. All the normal Emacs editing operations are
+ − 191 available for editing these fields. The only restriction is that each
+ − 192 change you make must be contained within a single editable text field.
+ − 193 For example, capitalizing all text from the middle of one field to the
+ − 194 middle of another field is prohibited.
+ − 195
+ − 196 Editing text fields are created by the @code{editable-field} widget.
+ − 197
+ − 198 The editing text fields are highlighted with the
+ − 199 @code{widget-field-face} face, making them easy to find.
+ − 200
+ − 201 @deffn Face widget-field-face
+ − 202 Face used for other editing fields.
+ − 203 @end deffn
+ − 204
+ − 205 @subsection Buttons
+ − 206
+ − 207 Some portions of the buffer have an associated @dfn{action}, which can
+ − 208 be @dfn{invoked} by a standard key or mouse command. These portions
+ − 209 are called @dfn{buttons}. The default commands for activating a button
+ − 210 are:
+ − 211
+ − 212 @table @kbd
+ − 213 @item @key{RET}
+ − 214 @deffn Command widget-button-press @var{pos} &optional @var{event}
+ − 215 Invoke the button at @var{pos}, defaulting to point.
+ − 216 If point is not located on a button, invoke the binding in
+ − 217 @code{widget-global-map} (by default the global map).
+ − 218 @end deffn
+ − 219
+ − 220 @item mouse-2
+ − 221 @deffn Command widget-button-click @var{event}
+ − 222 Invoke the button at the location of the mouse pointer. If the mouse
+ − 223 pointer is located in an editable text field, invoke the binding in
+ − 224 @code{widget-global-map} (by default the global map).
+ − 225 @end deffn
+ − 226 @end table
+ − 227
+ − 228 There are several different kind of buttons, all of which are present in
+ − 229 the example:
+ − 230
+ − 231 @table @emph
+ − 232 @item The Option Field Tags.
+ − 233 When you invoke one of these buttons, you will be asked to choose
+ − 234 between a number of different options. This is how you edit an option
+ − 235 field. Option fields are created by the @code{menu-choice} widget. In
+ − 236 the example, @samp{@b{Choose}} is an option field tag.
+ − 237 @item The @samp{@b{[INS]}} and @samp{@b{[DEL]}} buttons.
904
+ − 238 Activating these will insert or delete elements from an editable list.
428
+ − 239 The list is created by the @code{editable-list} widget.
+ − 240 @item Embedded Buttons.
+ − 241 The @samp{@b{_other work_}} is an example of an embedded
+ − 242 button. Embedded buttons are not associated with a fields, but can serve
+ − 243 any purpose, such as implementing hypertext references. They are
+ − 244 usually created by the @code{link} widget.
+ − 245 @item The @samp{@b{[ ]}} and @samp{@b{[X]}} buttons.
+ − 246 Activating one of these will convert it to the other. This is useful
+ − 247 for implementing multiple-choice fields. You can create it wit
+ − 248 @item The @samp{@b{( )}} and @samp{@b{(*)}} buttons.
+ − 249 Only one radio button in a @code{radio-button-choice} widget can be
+ − 250 selected at any time. When you invoke one of the unselected radio
+ − 251 buttons, it will be selected and the previous selected radio button will
+ − 252 become unselected.
+ − 253 @item The @samp{@b{[Apply Form]}} @samp{@b{[Reset Form]}} buttons.
+ − 254 These are explicit buttons made with the @code{push-button} widget. The main
+ − 255 difference from the @code{link} widget is that the buttons are will be
+ − 256 displayed as GUI buttons when possible.
+ − 257 enough.
+ − 258 @end table
+ − 259
+ − 260 To make them easier to locate, buttons are emphasized in the buffer.
+ − 261
+ − 262 @deffn Face widget-button-face
+ − 263 Face used for buttons.
+ − 264 @end deffn
+ − 265
+ − 266 @defopt widget-mouse-face
+ − 267 Face used for buttons when the mouse pointer is above it.
+ − 268 @end defopt
+ − 269
+ − 270 @subsection Navigation
+ − 271
+ − 272 You can use all the normal Emacs commands to move around in a form
+ − 273 buffer, plus you will have these additional commands:
+ − 274
+ − 275 @table @kbd
+ − 276 @item @key{TAB}
+ − 277 @deffn Command widget-forward &optional count
+ − 278 Move point @var{count} buttons or editing fields forward.
+ − 279 @end deffn
+ − 280 @item @key{M-TAB}
+ − 281 @deffn Command widget-backward &optional count
+ − 282 Move point @var{count} buttons or editing fields backward.
+ − 283 @end deffn
+ − 284 @end table
+ − 285
+ − 286 @node Programming Example, Setting Up the Buffer, User Interface, Top
+ − 287 @comment node-name, next, previous, up
+ − 288 @section Programming Example
+ − 289
+ − 290 Here is the code to implement the user interface example (see @ref{User
+ − 291 Interface}).
+ − 292
+ − 293 @lisp
+ − 294 (require 'widget)
+ − 295
+ − 296 (eval-when-compile
+ − 297 (require 'wid-edit))
+ − 298
+ − 299 (defvar widget-example-repeat)
+ − 300
+ − 301 (defun widget-example ()
+ − 302 "Create the widgets from the Widget manual."
+ − 303 (interactive)
+ − 304 (kill-buffer (get-buffer-create "*Widget Example*"))
+ − 305 (switch-to-buffer (get-buffer-create "*Widget Example*"))
+ − 306 (kill-all-local-variables)
+ − 307 (make-local-variable 'widget-example-repeat)
+ − 308 (widget-insert "Here is some documentation.\n\nName: ")
+ − 309 (widget-create 'editable-field
440
+ − 310 :size 13
+ − 311 "My Name")
428
+ − 312 (widget-create 'menu-choice
440
+ − 313 :tag "Choose"
+ − 314 :value "This"
+ − 315 :help-echo "Choose me, please!"
+ − 316 :notify (lambda (widget &rest ignore)
+ − 317 (message "%s is a good choice!"
+ − 318 (widget-value widget)))
+ − 319 '(item :tag "This option" :value "This")
+ − 320 '(choice-item "That option")
+ − 321 '(editable-field :menu-tag "No option" "Thus option"))
428
+ − 322 (widget-insert "Address: ")
+ − 323 (widget-create 'editable-field
440
+ − 324 "Some Place\nIn some City\nSome country.")
428
+ − 325 (widget-insert "\nSee also ")
+ − 326 (widget-create 'link
440
+ − 327 :notify (lambda (&rest ignore)
+ − 328 (widget-value-set widget-example-repeat
+ − 329 '("En" "To" "Tre"))
+ − 330 (widget-setup))
+ − 331 "other work")
428
+ − 332 (widget-insert " for more information.\n\nNumbers: count to three below\n")
+ − 333 (setq widget-example-repeat
440
+ − 334 (widget-create 'editable-list
+ − 335 :entry-format "%i %d %v"
+ − 336 :notify (lambda (widget &rest ignore)
+ − 337 (let ((old (widget-get widget
+ − 338 ':example-length))
+ − 339 (new (length (widget-value widget))))
+ − 340 (unless (eq old new)
+ − 341 (widget-put widget ':example-length new)
+ − 342 (message "You can count to %d." new))))
+ − 343 :value '("One" "Eh, two?" "Five!")
+ − 344 '(editable-field :value "three")))
428
+ − 345 (widget-insert "\n\nSelect multiple:\n\n")
+ − 346 (widget-create 'checkbox t)
+ − 347 (widget-insert " This\n")
+ − 348 (widget-create 'checkbox nil)
+ − 349 (widget-insert " That\n")
+ − 350 (widget-create 'checkbox
440
+ − 351 :notify (lambda (&rest ignore) (message "Tickle"))
+ − 352 t)
428
+ − 353 (widget-insert " Thus\n\nSelect one:\n\n")
+ − 354 (widget-create 'radio-button-choice
440
+ − 355 :value "One"
+ − 356 :notify (lambda (widget &rest ignore)
+ − 357 (message "You selected %s"
+ − 358 (widget-value widget)))
+ − 359 '(item "One") '(item "Another One.") '(item "A Final One."))
428
+ − 360 (widget-insert "\n")
+ − 361 (widget-create 'push-button
440
+ − 362 :notify (lambda (&rest ignore)
+ − 363 (if (= (length (widget-value widget-example-repeat))
+ − 364 3)
+ − 365 (message "Congratulation!")
+ − 366 (error "Three was the count!")))
+ − 367 "Apply Form")
428
+ − 368 (widget-insert " ")
+ − 369 (widget-create 'push-button
440
+ − 370 :notify (lambda (&rest ignore)
+ − 371 (widget-example))
+ − 372 "Reset Form")
428
+ − 373 (widget-insert "\n")
+ − 374 (use-local-map widget-keymap)
+ − 375 (widget-setup))
+ − 376 @end lisp
+ − 377
+ − 378 @node Setting Up the Buffer, Basic Types, Programming Example, Top
+ − 379 @comment node-name, next, previous, up
+ − 380 @section Setting Up the Buffer
+ − 381
+ − 382 Widgets are created with @code{widget-create}, which returns a
+ − 383 @dfn{widget} object. This object can be queried and manipulated by
+ − 384 other widget functions, until it is deleted with @code{widget-delete}.
+ − 385 After the widgets have been created, @code{widget-setup} must be called
+ − 386 to enable them.
+ − 387
+ − 388 @defun widget-create type [ keyword argument ]@dots{}
+ − 389 Create and return a widget of type @var{type}.
+ − 390 The syntax for the @var{type} argument is described in @ref{Basic Types}.
+ − 391
+ − 392 The keyword arguments can be used to overwrite the keyword arguments
+ − 393 that are part of @var{type}.
+ − 394 @end defun
+ − 395
+ − 396 @defun widget-delete widget
+ − 397 Delete @var{widget} and remove it from the buffer.
+ − 398 @end defun
+ − 399
+ − 400 @defun widget-setup
+ − 401 Setup a buffer to support widgets.
+ − 402
+ − 403 This should be called after creating all the widgets and before allowing
+ − 404 the user to edit them.
+ − 405 @refill
+ − 406 @end defun
+ − 407
+ − 408 If you want to insert text outside the widgets in the form, the
+ − 409 recommended way to do that is with @code{widget-insert}.
+ − 410
+ − 411 @defun widget-insert
+ − 412 Insert the arguments, either strings or characters, at point.
+ − 413 The inserted text will be read only.
+ − 414 @end defun
+ − 415
+ − 416 There is a standard widget keymap which you might find useful.
+ − 417
+ − 418 @defvr Const widget-keymap
+ − 419 A keymap with the global keymap as its parent.@*
+ − 420 @key{TAB} and @kbd{C-@key{TAB}} are bound to @code{widget-forward} and
+ − 421 @code{widget-backward}, respectively. @kbd{@key{RET}} and @kbd{mouse-2}
+ − 422 are bound to @code{widget-button-press} and
+ − 423 @code{widget-button-}.@refill
+ − 424 @end defvr
+ − 425
+ − 426 @defvar widget-global-map
+ − 427 Keymap used by @code{widget-button-press} and @code{widget-button-click}
+ − 428 when not on a button. By default this is @code{global-map}.
+ − 429 @end defvar
+ − 430
+ − 431 @node Basic Types, Sexp Types, Setting Up the Buffer, Top
+ − 432 @comment node-name, next, previous, up
+ − 433 @section Basic Types
+ − 434
+ − 435 The syntax of a type specification is given below:
+ − 436
+ − 437 @example
+ − 438 NAME ::= (NAME [KEYWORD ARGUMENT]... ARGS)
+ − 439 | NAME
+ − 440 @end example
+ − 441
444
+ − 442 where @var{name} is a widget name, @var{keyword} is the name of a
428
+ − 443 property, @var{argument} is the value of the property, and @var{args}
+ − 444 are interpreted in a widget specific way.
+ − 445
+ − 446 There following keyword arguments that apply to all widgets:
+ − 447
+ − 448 @table @code
+ − 449 @item :value
+ − 450 The initial value for widgets of this type.
+ − 451
+ − 452 @item :format
+ − 453 This string will be inserted in the buffer when you create a widget.
+ − 454 The following @samp{%} escapes are available:
+ − 455
+ − 456 @table @samp
+ − 457 @item %[
+ − 458 @itemx %]
+ − 459 The text inside will be marked as a button.
+ − 460
+ − 461 By default, the text will be shown in @code{widget-button-face}, and
+ − 462 surrounded by brackets.
+ − 463
+ − 464 @defopt widget-button-prefix
+ − 465 String to prefix buttons.
+ − 466 @end defopt
+ − 467
+ − 468 @defopt widget-button-suffix
+ − 469 String to suffix buttons.
+ − 470 @end defopt
+ − 471
+ − 472 @item %@{
+ − 473 @itemx %@}
434
+ − 474 The text inside will be displayed in the face specified by
+ − 475 @code{:sample-face}.
428
+ − 476
+ − 477 @item %v
434
+ − 478 This will be replaced with the buffer representation of the widget's
428
+ − 479 value. What this is depends on the widget type.
+ − 480
+ − 481 @item %d
+ − 482 Insert the string specified by @code{:doc} here.
+ − 483
+ − 484 @item %h
+ − 485 Like @samp{%d}, with the following modifications: If the documentation
+ − 486 string is more than one line, it will add a button which will toggle
+ − 487 between showing only the first line, and showing the full text.
+ − 488 Furthermore, if there is no @code{:doc} property in the widget, it will
+ − 489 instead examine the @code{:documentation-property} property. If it is a
+ − 490 lambda expression, it will be called with the widget's value as an
+ − 491 argument, and the result will be used as the documentation text.
+ − 492
+ − 493 @item %t
+ − 494 Insert the string specified by @code{:tag} here, or the @code{princ}
+ − 495 representation of the value if there is no tag.
+ − 496
+ − 497 @item %%
+ − 498 Insert a literal @samp{%}.
+ − 499 @end table
+ − 500
+ − 501 @item :button-face
+ − 502 Face used to highlight text inside %[ %] in the format.
+ − 503
+ − 504 @item :button-prefix
+ − 505 @itemx :button-suffix
+ − 506
+ − 507 Text around %[ %] in the format.
+ − 508
+ − 509 These can be
+ − 510 @table @emph
+ − 511 @item nil
+ − 512 No text is inserted.
+ − 513
+ − 514 @item a string
+ − 515 The string is inserted literally.
+ − 516
+ − 517 @item a symbol
+ − 518 The value of the symbol is expanded according to this table.
+ − 519 @end table
+ − 520
+ − 521 @item :doc
444
+ − 522 The string inserted by the @samp{%d} or @samp{%h} escape in the format
428
+ − 523 string.
+ − 524
+ − 525 @item :tag
+ − 526 The string inserted by the @samp{%t} escape in the format
+ − 527 string.
+ − 528
+ − 529 @item :tag-glyph
+ − 530 Name of image to use instead of the string specified by `:tag' on
+ − 531 Emacsen that supports it.
+ − 532
+ − 533 @item :help-echo
+ − 534 Message displayed whenever you move to the widget with either
+ − 535 @code{widget-forward} or @code{widget-backward}.
+ − 536
+ − 537 @item :indent
+ − 538 An integer indicating the absolute number of spaces to indent children
+ − 539 of this widget.
+ − 540
+ − 541 @item :offset
+ − 542 An integer indicating how many extra spaces to add to the widget's
+ − 543 grandchildren compared to this widget.
+ − 544
+ − 545 @item :extra-offset
+ − 546 An integer indicating how many extra spaces to add to the widget's
+ − 547 children compared to this widget.
+ − 548
+ − 549 @item :notify
+ − 550 A function called each time the widget or a nested widget is changed.
+ − 551 The function is called with two or three arguments. The first argument
+ − 552 is the widget itself, the second argument is the widget that was
+ − 553 changed, and the third argument is the event leading to the change, if
652
+ − 554 any. In editable fields, this includes all insertions, deletions,
+ − 555 @emph{etc}. To watch only for ``final'' actions, redefine the
+ − 556 @code{:action} callback.
428
+ − 557
+ − 558 @item :menu-tag
+ − 559 Tag used in the menu when the widget is used as an option in a
+ − 560 @code{menu-choice} widget.
+ − 561
+ − 562 @item :menu-tag-get
+ − 563 Function used for finding the tag when the widget is used as an option
+ − 564 in a @code{menu-choice} widget. By default, the tag used will be either the
+ − 565 @code{:menu-tag} or @code{:tag} property if present, or the @code{princ}
+ − 566 representation of the @code{:value} property if not.
+ − 567
+ − 568 @item :match
+ − 569 Should be a function called with two arguments, the widget and a value,
+ − 570 and returning non-nil if the widget can represent the specified value.
+ − 571
+ − 572 @item :validate
444
+ − 573 A function which takes a widget as an argument, and returns nil if the
434
+ − 574 widget's current value is valid for the widget. Otherwise it should
+ − 575 return the widget containing the invalid data, and set that widget's
428
+ − 576 @code{:error} property to a string explaining the error.
+ − 577
+ − 578 The following predefined function can be used:
+ − 579
+ − 580 @defun widget-children-validate widget
+ − 581 All the @code{:children} of @var{widget} must be valid.
+ − 582 @end defun
+ − 583
+ − 584 @item :tab-order
+ − 585 Specify the order in which widgets are traversed with
+ − 586 @code{widget-forward} or @code{widget-backward}. This is only partially
+ − 587 implemented.
+ − 588
+ − 589 @enumerate a
+ − 590 @item
+ − 591 Widgets with tabbing order @code{-1} are ignored.
+ − 592
+ − 593 @item
+ − 594 (Unimplemented) When on a widget with tabbing order @var{n}, go to the
+ − 595 next widget in the buffer with tabbing order @var{n+1} or @code{nil},
+ − 596 whichever comes first.
+ − 597
+ − 598 @item
+ − 599 When on a widget with no tabbing order specified, go to the next widget
+ − 600 in the buffer with a positive tabbing order, or @code{nil}
+ − 601 @end enumerate
+ − 602
+ − 603 @item :parent
+ − 604 The parent of a nested widget (e.g. a @code{menu-choice} item or an
904
+ − 605 element of an @code{editable-list} widget).
428
+ − 606
+ − 607 @item :sibling-args
+ − 608 This keyword is only used for members of a @code{radio-button-choice} or
+ − 609 @code{checklist}. The value should be a list of extra keyword
+ − 610 arguments, which will be used when creating the @code{radio-button} or
+ − 611 @code{checkbox} associated with this item.
+ − 612
+ − 613 @end table
+ − 614
+ − 615 @deffn {User Option} widget-glyph-directory
+ − 616 Directory where glyphs are found.
+ − 617 Widget will look here for a file with the same name as specified for the
+ − 618 image, with either a @samp{.xpm} (if supported) or @samp{.xbm} extension.
+ − 619 @end deffn
+ − 620
+ − 621 @deffn{User Option} widget-glyph-enable
+ − 622 If non-nil, allow glyphs to appear on displays where they are supported.
+ − 623 @end deffn
+ − 624
+ − 625
+ − 626 @menu
+ − 627 * link::
+ − 628 * url-link::
+ − 629 * info-link::
+ − 630 * push-button::
+ − 631 * editable-field::
+ − 632 * text::
+ − 633 * menu-choice::
+ − 634 * radio-button-choice::
+ − 635 * item::
+ − 636 * choice-item::
+ − 637 * toggle::
+ − 638 * checkbox::
+ − 639 * checklist::
+ − 640 * editable-list::
+ − 641 * group::
+ − 642 @end menu
+ − 643
+ − 644 @node link, url-link, Basic Types, Basic Types
+ − 645 @comment node-name, next, previous, up
+ − 646 @subsection The @code{link} Widget
+ − 647
+ − 648 Syntax:
+ − 649
+ − 650 @example
+ − 651 TYPE ::= (link [KEYWORD ARGUMENT]... [ VALUE ])
+ − 652 @end example
+ − 653
+ − 654 The @var{value}, if present, is used to initialize the @code{:value}
+ − 655 property. The value should be a string, which will be inserted in the
+ − 656 buffer.
+ − 657
+ − 658 By default the link will be shown in brackets.
+ − 659
+ − 660 @defopt widget-link-prefix
+ − 661 String to prefix links.
+ − 662 @end defopt
+ − 663
+ − 664 @defopt widget-link-suffix
+ − 665 String to suffix links.
+ − 666 @end defopt
+ − 667
+ − 668 @node url-link, info-link, link, Basic Types
+ − 669 @comment node-name, next, previous, up
+ − 670 @subsection The @code{url-link} Widget
+ − 671
+ − 672 Syntax:
+ − 673
+ − 674 @example
+ − 675 TYPE ::= (url-link [KEYWORD ARGUMENT]... URL)
+ − 676 @end example
+ − 677
+ − 678 When this link is invoked, the @sc{www} browser specified by
+ − 679 @code{browse-url-browser-function} will be called with @var{url}.
+ − 680
+ − 681 @node info-link, push-button, url-link, Basic Types
+ − 682 @comment node-name, next, previous, up
+ − 683 @subsection The @code{info-link} Widget
+ − 684
+ − 685 Syntax:
+ − 686
+ − 687 @example
+ − 688 TYPE ::= (info-link [KEYWORD ARGUMENT]... ADDRESS)
+ − 689 @end example
+ − 690
+ − 691 When this link is invoked, the built-in info browser is started on
+ − 692 @var{address}.
+ − 693
+ − 694 @node push-button, editable-field, info-link, Basic Types
+ − 695 @comment node-name, next, previous, up
+ − 696 @subsection The @code{push-button} Widget
+ − 697
+ − 698 Syntax:
+ − 699
+ − 700 @example
+ − 701 TYPE ::= (push-button [KEYWORD ARGUMENT]... [ VALUE ])
+ − 702 @end example
+ − 703
+ − 704 The @var{value}, if present, is used to initialize the @code{:value}
+ − 705 property. The value should be a string, which will be inserted in the
+ − 706 buffer.
+ − 707
+ − 708 By default the tag will be shown in brackets.
+ − 709
+ − 710 @defopt widget-push-button-prefix
+ − 711 String to prefix push buttons.
+ − 712 @end defopt
+ − 713
+ − 714 @defopt widget-push-button-suffix
+ − 715 String to suffix push buttons.
+ − 716 @end defopt
+ − 717
+ − 718 @node editable-field, text, push-button, Basic Types
+ − 719 @comment node-name, next, previous, up
+ − 720 @subsection The @code{editable-field} Widget
+ − 721
+ − 722 Syntax:
+ − 723
+ − 724 @example
+ − 725 TYPE ::= (editable-field [KEYWORD ARGUMENT]... [ VALUE ])
+ − 726 @end example
+ − 727
+ − 728 The @var{value}, if present, is used to initialize the @code{:value}
+ − 729 property. The value should be a string, which will be inserted in
+ − 730 field. This widget will match all string values.
+ − 731
+ − 732 The following extra properties are recognized.
+ − 733
+ − 734 @table @code
+ − 735 @item :size
444
+ − 736 The minimum width of the editable field.@*
+ − 737 By default the field will reach to the end of the line. If the
+ − 738 content is too large, the displayed representation will expand to
+ − 739 contain it. The content is not truncated to size.
428
+ − 740
+ − 741 @item :value-face
+ − 742 Face used for highlighting the editable field. Default is
+ − 743 @code{widget-field-face}.
+ − 744
+ − 745 @item :secret
+ − 746 Character used to display the value. You can set this to e.g. @code{?*}
+ − 747 if the field contains a password or other secret information. By
+ − 748 default, the value is not secret.
+ − 749
+ − 750 @item :valid-regexp
+ − 751 By default the @code{:validate} function will match the content of the
+ − 752 field with the value of this attribute. The default value is @code{""}
+ − 753 which matches everything.
+ − 754
+ − 755 @item :keymap
+ − 756 Keymap used in the editable field. The default value is
+ − 757 @code{widget-field-keymap}, which allows you to use all the normal
444
+ − 758 editing commands, even if the buffer's major mode suppress some of them.
428
+ − 759 Pressing return invokes the function specified by @code{:action}.
+ − 760 @end table
+ − 761
+ − 762 @node text, menu-choice, editable-field, Basic Types
+ − 763 @comment node-name, next, previous, up
+ − 764 @subsection The @code{text} Widget
+ − 765
+ − 766 This is just like @code{editable-field}, but intended for multiline text
+ − 767 fields. The default @code{:keymap} is @code{widget-text-keymap}, which
+ − 768 does not rebind the return key.
+ − 769
+ − 770 @node menu-choice, radio-button-choice, text, Basic Types
+ − 771 @comment node-name, next, previous, up
+ − 772 @subsection The @code{menu-choice} Widget
+ − 773
+ − 774 Syntax:
+ − 775
+ − 776 @example
+ − 777 TYPE ::= (menu-choice [KEYWORD ARGUMENT]... TYPE ... )
+ − 778 @end example
+ − 779
434
+ − 780 The @var{type} argument represents each possible choice. The widget's
+ − 781 value will be that of the chosen @var{type} argument. This widget will
+ − 782 match any value matching at least one of the specified @var{type}
+ − 783 arguments.
428
+ − 784
+ − 785 @table @code
+ − 786 @item :void
+ − 787 Widget type used as a fallback when the value does not match any of the
+ − 788 specified @var{type} arguments.
+ − 789
+ − 790 @item :case-fold
+ − 791 Set this to nil if you don't want to ignore case when prompting for a
+ − 792 choice through the minibuffer.
+ − 793
+ − 794 @item :children
+ − 795 A list whose car is the widget representing the currently chosen type in
+ − 796 the buffer.
+ − 797
+ − 798 @item :choice
+ − 799 The current chosen type
+ − 800
+ − 801 @item :args
+ − 802 The list of types.
+ − 803 @end table
+ − 804
+ − 805 @node radio-button-choice, item, menu-choice, Basic Types
+ − 806 @comment node-name, next, previous, up
+ − 807 @subsection The @code{radio-button-choice} Widget
+ − 808
+ − 809 Syntax:
+ − 810
+ − 811 @example
+ − 812 TYPE ::= (radio-button-choice [KEYWORD ARGUMENT]... TYPE ... )
+ − 813 @end example
+ − 814
434
+ − 815 The @var{type} argument represents each possible choice. The widget's
+ − 816 value will be that of the chosen @var{type} argument. This widget will
+ − 817 match any value matching at least one of the specified @var{type}
+ − 818 arguments.
428
+ − 819
+ − 820 The following extra properties are recognized.
+ − 821
+ − 822 @table @code
+ − 823 @item :entry-format
+ − 824 This string will be inserted for each entry in the list.
+ − 825 The following @samp{%} escapes are available:
+ − 826 @table @samp
+ − 827 @item %v
+ − 828 Replaced with the buffer representation of the @var{type} widget.
+ − 829 @item %b
+ − 830 Replace with the radio button.
+ − 831 @item %%
+ − 832 Insert a literal @samp{%}.
+ − 833 @end table
+ − 834
+ − 835 @item button-args
+ − 836 A list of keywords to pass to the radio buttons. Useful for setting
+ − 837 e.g. the @samp{:help-echo} for each button.
+ − 838
+ − 839 @item :buttons
+ − 840 The widgets representing the radio buttons.
+ − 841
+ − 842 @item :children
+ − 843 The widgets representing each type.
+ − 844
+ − 845 @item :choice
+ − 846 The current chosen type
+ − 847
+ − 848 @item :args
+ − 849 The list of types.
+ − 850 @end table
+ − 851
+ − 852 You can add extra radio button items to a @code{radio-button-choice}
+ − 853 widget after it has been created with the function
+ − 854 @code{widget-radio-add-item}.
+ − 855
+ − 856 @defun widget-radio-add-item widget type
+ − 857 Add to @code{radio-button-choice} widget @var{widget} a new radio button item of type
+ − 858 @var{type}.
+ − 859 @end defun
+ − 860
+ − 861 Please note that such items added after the @code{radio-button-choice}
+ − 862 widget has been created will @strong{not} be properly destructed when
+ − 863 you call @code{widget-delete}.
+ − 864
+ − 865 @node item, choice-item, radio-button-choice, Basic Types
+ − 866 @comment node-name, next, previous, up
+ − 867 @subsection The @code{item} Widget
+ − 868
+ − 869 Syntax:
+ − 870
+ − 871 @example
+ − 872 ITEM ::= (item [KEYWORD ARGUMENT]... VALUE)
+ − 873 @end example
+ − 874
+ − 875 The @var{value}, if present, is used to initialize the @code{:value}
+ − 876 property. The value should be a string, which will be inserted in the
+ − 877 buffer. This widget will only match the specified value.
+ − 878
+ − 879 @node choice-item, toggle, item, Basic Types
+ − 880 @comment node-name, next, previous, up
+ − 881 @subsection The @code{choice-item} Widget
+ − 882
+ − 883 Syntax:
+ − 884
+ − 885 @example
+ − 886 ITEM ::= (choice-item [KEYWORD ARGUMENT]... VALUE)
+ − 887 @end example
+ − 888
+ − 889 The @var{value}, if present, is used to initialize the @code{:value}
+ − 890 property. The value should be a string, which will be inserted in the
+ − 891 buffer as a button. Activating the button of a @code{choice-item} is
+ − 892 equivalent to activating the parent widget. This widget will only match
+ − 893 the specified value.
+ − 894
+ − 895 @node toggle, checkbox, choice-item, Basic Types
+ − 896 @comment node-name, next, previous, up
+ − 897 @subsection The @code{toggle} Widget
+ − 898
+ − 899 Syntax:
+ − 900
+ − 901 @example
+ − 902 TYPE ::= (toggle [KEYWORD ARGUMENT]...)
+ − 903 @end example
+ − 904
434
+ − 905 The widget has two possible states, `on' and `off', which correspond to
+ − 906 a @code{t} or @code{nil} value respectively.
428
+ − 907
+ − 908 The following extra properties are recognized.
+ − 909
+ − 910 @table @code
+ − 911 @item :on
+ − 912 String representing the `on' state. By default the string @samp{on}.
+ − 913 @item :off
+ − 914 String representing the `off' state. By default the string @samp{off}.
+ − 915 @item :on-glyph
+ − 916 Name of a glyph to be used instead of the `:on' text string, on emacsen
+ − 917 that supports it.
+ − 918 @item :off-glyph
+ − 919 Name of a glyph to be used instead of the `:off' text string, on emacsen
+ − 920 that supports it.
+ − 921 @end table
+ − 922
+ − 923 @node checkbox, checklist, toggle, Basic Types
+ − 924 @comment node-name, next, previous, up
+ − 925 @subsection The @code{checkbox} Widget
+ − 926
+ − 927 The widget has two possible states, `selected' and `unselected', which
+ − 928 corresponds to a @code{t} or @code{nil} value.
+ − 929
+ − 930 Syntax:
+ − 931
+ − 932 @example
+ − 933 TYPE ::= (checkbox [KEYWORD ARGUMENT]...)
+ − 934 @end example
+ − 935
+ − 936 @node checklist, editable-list, checkbox, Basic Types
+ − 937 @comment node-name, next, previous, up
+ − 938 @subsection The @code{checklist} Widget
+ − 939
+ − 940 Syntax:
+ − 941
+ − 942 @example
+ − 943 TYPE ::= (checklist [KEYWORD ARGUMENT]... TYPE ... )
+ − 944 @end example
+ − 945
434
+ − 946 The @var{type} arguments represents each checklist item. The widget's
+ − 947 value will be a list containing the values of all ticked @var{type}
+ − 948 arguments. The checklist widget will match a list whose elements all
+ − 949 match at least one of the specified @var{type} arguments.
428
+ − 950
+ − 951 The following extra properties are recognized.
+ − 952
+ − 953 @table @code
+ − 954 @item :entry-format
+ − 955 This string will be inserted for each entry in the list.
+ − 956 The following @samp{%} escapes are available:
+ − 957 @table @samp
+ − 958 @item %v
+ − 959 Replaced with the buffer representation of the @var{type} widget.
+ − 960 @item %b
+ − 961 Replace with the checkbox.
+ − 962 @item %%
+ − 963 Insert a literal @samp{%}.
+ − 964 @end table
+ − 965
+ − 966 @item :greedy
434
+ − 967 Usually a checklist will only match if the items are in the exact
428
+ − 968 sequence given in the specification. By setting @code{:greedy} to
434
+ − 969 non-nil, it will allow the items to appear in any sequence. However, if
+ − 970 you extract the values they will be in the sequence given in the
+ − 971 checklist. I.e. the original sequence is forgotten.
428
+ − 972
+ − 973 @item button-args
+ − 974 A list of keywords to pass to the checkboxes. Useful for setting
+ − 975 e.g. the @samp{:help-echo} for each checkbox.
+ − 976
+ − 977 @item :buttons
+ − 978 The widgets representing the checkboxes.
+ − 979
+ − 980 @item :children
+ − 981 The widgets representing each type.
+ − 982
+ − 983 @item :args
+ − 984 The list of types.
+ − 985 @end table
+ − 986
+ − 987 @node editable-list, group, checklist, Basic Types
+ − 988 @comment node-name, next, previous, up
+ − 989 @subsection The @code{editable-list} Widget
+ − 990
+ − 991 Syntax:
+ − 992
+ − 993 @example
+ − 994 TYPE ::= (editable-list [KEYWORD ARGUMENT]... TYPE)
+ − 995 @end example
+ − 996
+ − 997 The value is a list, where each member represents one widget of type
+ − 998 @var{type}.
+ − 999
+ − 1000 The following extra properties are recognized.
+ − 1001
+ − 1002 @table @code
+ − 1003 @item :entry-format
+ − 1004 This string will be inserted for each entry in the list.
+ − 1005 The following @samp{%} escapes are available:
+ − 1006 @table @samp
+ − 1007 @item %v
+ − 1008 This will be replaced with the buffer representation of the @var{type}
+ − 1009 widget.
+ − 1010 @item %i
+ − 1011 Insert the @b{[INS]} button.
+ − 1012 @item %d
+ − 1013 Insert the @b{[DEL]} button.
+ − 1014 @item %%
+ − 1015 Insert a literal @samp{%}.
+ − 1016 @end table
+ − 1017
+ − 1018 @item :insert-button-args
+ − 1019 A list of keyword arguments to pass to the insert buttons.
+ − 1020
+ − 1021 @item :delete-button-args
+ − 1022 A list of keyword arguments to pass to the delete buttons.
+ − 1023
+ − 1024 @item :append-button-args
+ − 1025 A list of keyword arguments to pass to the trailing insert button.
+ − 1026
+ − 1027
+ − 1028 @item :buttons
+ − 1029 The widgets representing the insert and delete buttons.
+ − 1030
+ − 1031 @item :children
+ − 1032 The widgets representing the elements of the list.
+ − 1033
+ − 1034 @item :args
+ − 1035 List whose car is the type of the list elements.
+ − 1036
+ − 1037 @end table
+ − 1038
+ − 1039 @node group, , editable-list, Basic Types
+ − 1040 @comment node-name, next, previous, up
+ − 1041 @subsection The @code{group} Widget
+ − 1042
904
+ − 1043 This widget simply groups other widgets together.
428
+ − 1044
+ − 1045 Syntax:
+ − 1046
+ − 1047 @example
+ − 1048 TYPE ::= (group [KEYWORD ARGUMENT]... TYPE...)
+ − 1049 @end example
+ − 1050
+ − 1051 The value is a list, with one member for each @var{type}.
+ − 1052
+ − 1053 @node Sexp Types, Widget Properties, Basic Types, Top
+ − 1054 @comment
+ − 1055 @section Sexp Types
+ − 1056
+ − 1057 A number of widgets for editing s-expressions (lisp types) are also
+ − 1058 available. These basically fall in the following categories.
+ − 1059
+ − 1060 @menu
+ − 1061 * constants::
+ − 1062 * generic::
+ − 1063 * atoms::
+ − 1064 * composite::
+ − 1065 @end menu
+ − 1066
+ − 1067 @node constants, generic, Sexp Types, Sexp Types
+ − 1068 @comment node-name, next, previous, up
+ − 1069 @subsection The Constant Widgets.
+ − 1070
+ − 1071 The @code{const} widget can contain any lisp expression, but the user is
785
+ − 1072 prohibited from editing it, which is mainly useful as a component of one
+ − 1073 of the composite widgets.
428
+ − 1074
+ − 1075 The syntax for the @code{const} widget is
+ − 1076
+ − 1077 @example
+ − 1078 TYPE ::= (const [KEYWORD ARGUMENT]... [ VALUE ])
+ − 1079 @end example
+ − 1080
+ − 1081 The @var{value}, if present, is used to initialize the @code{:value}
+ − 1082 property and can be any s-expression.
+ − 1083
+ − 1084 @deffn Widget const
+ − 1085 This will display any valid s-expression in an immutable part of the
+ − 1086 buffer.
+ − 1087 @end deffn
+ − 1088
+ − 1089 There are two variations of the @code{const} widget, namely
+ − 1090 @code{variable-item} and @code{function-item}. These should contain a
+ − 1091 symbol with a variable or function binding. The major difference from
+ − 1092 the @code{const} widget is that they will allow the user to see the
+ − 1093 variable or function documentation for the symbol.
+ − 1094
+ − 1095 @deffn Widget variable-item
+ − 1096 An immutable symbol that is bound as a variable.
+ − 1097 @end deffn
+ − 1098
+ − 1099 @deffn Widget function-item
+ − 1100 An immutable symbol that is bound as a function.
+ − 1101 @end deffn
+ − 1102
+ − 1103 @node generic, atoms, constants, Sexp Types
+ − 1104 @comment node-name, next, previous, up
+ − 1105 @subsection Generic Sexp Widget.
+ − 1106
+ − 1107 The @code{sexp} widget can contain any lisp expression, and allows the
+ − 1108 user to edit it inline in the buffer.
+ − 1109
+ − 1110 The syntax for the @code{sexp} widget is
+ − 1111
+ − 1112 @example
+ − 1113 TYPE ::= (sexp [KEYWORD ARGUMENT]... [ VALUE ])
+ − 1114 @end example
+ − 1115
+ − 1116 @deffn Widget sexp
+ − 1117 This will allow you to edit any valid s-expression in an editable buffer
+ − 1118 field.
+ − 1119
+ − 1120 The @code{sexp} widget takes the same keyword arguments as the
+ − 1121 @code{editable-field} widget.
+ − 1122 @end deffn
+ − 1123
+ − 1124 @node atoms, composite, generic, Sexp Types
+ − 1125 @comment node-name, next, previous, up
+ − 1126 @subsection Atomic Sexp Widgets.
+ − 1127
+ − 1128 The atoms are s-expressions that does not consist of other
+ − 1129 s-expressions. A string is an atom, while a list is a composite type.
+ − 1130 You can edit the value of an atom with the following widgets.
+ − 1131
+ − 1132 The syntax for all the atoms are
+ − 1133
+ − 1134 @example
+ − 1135 TYPE ::= (NAME [KEYWORD ARGUMENT]... [ VALUE ])
+ − 1136 @end example
+ − 1137
+ − 1138 The @var{value}, if present, is used to initialize the @code{:value}
+ − 1139 property and must be an expression of the same type as the widget.
+ − 1140 I.e. the string widget can only be initialized with a string.
+ − 1141
+ − 1142 All the atom widgets take the same keyword arguments as the
+ − 1143 @code{editable-field} widget.
+ − 1144
+ − 1145 @deffn Widget string
+ − 1146 Allows you to edit a string in an editable field.
+ − 1147 @end deffn
+ − 1148
+ − 1149 @deffn Widget regexp
+ − 1150 Allows you to edit a regular expression in an editable field.
+ − 1151 @end deffn
+ − 1152
+ − 1153 @deffn Widget character
+ − 1154 Allows you to enter a character in an editable field.
+ − 1155 @end deffn
+ − 1156
+ − 1157 @deffn Widget file
+ − 1158 Allows you to edit a file name in an editable field. If you invoke
+ − 1159 the tag button, you can edit the file name in the mini-buffer with
+ − 1160 completion.
+ − 1161
+ − 1162 Keywords:
+ − 1163 @table @code
+ − 1164 @item :must-match
+ − 1165 If this is set to non-nil, only existing file names will be allowed in
+ − 1166 the minibuffer.
+ − 1167 @end table
+ − 1168 @end deffn
+ − 1169
+ − 1170 @deffn Widget directory
+ − 1171 Allows you to edit a directory name in an editable field.
+ − 1172 Similar to the @code{file} widget.
+ − 1173 @end deffn
+ − 1174
+ − 1175 @deffn Widget symbol
+ − 1176 Allows you to edit a lisp symbol in an editable field.
+ − 1177 @end deffn
+ − 1178
+ − 1179 @deffn Widget function
+ − 1180 Allows you to edit a lambda expression, or a function name with completion.
+ − 1181 @end deffn
+ − 1182
+ − 1183 @deffn Widget variable
+ − 1184 Allows you to edit a variable name, with completion.
+ − 1185 @end deffn
+ − 1186
+ − 1187 @deffn Widget integer
+ − 1188 Allows you to edit an integer in an editable field.
+ − 1189 @end deffn
+ − 1190
+ − 1191 @deffn Widget number
+ − 1192 Allows you to edit a number in an editable field.
+ − 1193 @end deffn
+ − 1194
+ − 1195 @deffn Widget boolean
+ − 1196 Allows you to edit a boolean. In lisp this means a variable which is
+ − 1197 either nil meaning false, or non-nil meaning true.
+ − 1198 @end deffn
+ − 1199
+ − 1200
+ − 1201 @node composite, , atoms, Sexp Types
+ − 1202 @comment node-name, next, previous, up
+ − 1203 @subsection Composite Sexp Widgets.
+ − 1204
+ − 1205 The syntax for the composite are
+ − 1206
+ − 1207 @example
+ − 1208 TYPE ::= (NAME [KEYWORD ARGUMENT]... COMPONENT...)
+ − 1209 @end example
+ − 1210
+ − 1211 Where each @var{component} must be a widget type. Each component widget
+ − 1212 will be displayed in the buffer, and be editable to the user.
+ − 1213
+ − 1214 @deffn Widget cons
+ − 1215 The value of a @code{cons} widget is a cons-cell where the car is the
+ − 1216 value of the first component and the cdr is the value of the second
+ − 1217 component. There must be exactly two components.
+ − 1218 @end deffn
+ − 1219
+ − 1220 @deffn Widget list
+ − 1221 The value of a @code{list} widget is a list containing the value of
+ − 1222 each of its component.
+ − 1223 @end deffn
+ − 1224
+ − 1225 @deffn Widget vector
+ − 1226 The value of a @code{vector} widget is a vector containing the value of
+ − 1227 each of its component.
+ − 1228 @end deffn
+ − 1229
+ − 1230 The above suffice for specifying fixed size lists and vectors. To get
+ − 1231 variable length lists and vectors, you can use a @code{choice},
+ − 1232 @code{set} or @code{repeat} widgets together with the @code{:inline}
+ − 1233 keywords. If any component of a composite widget has the @code{:inline}
+ − 1234 keyword set, its value must be a list which will then be spliced into
+ − 1235 the composite. For example, to specify a list whose first element must
+ − 1236 be a file name, and whose remaining arguments should either by the
+ − 1237 symbol @code{t} or two files, you can use the following widget
+ − 1238 specification:
+ − 1239
+ − 1240 @example
+ − 1241 (list file
+ − 1242 (choice (const t)
+ − 1243 (list :inline t
+ − 1244 :value ("foo" "bar")
+ − 1245 string string)))
+ − 1246 @end example
+ − 1247
+ − 1248 The value of a widget of this type will either have the form
+ − 1249 @samp{(file t)} or @code{(file string string)}.
+ − 1250
+ − 1251 This concept of inline is probably hard to understand. It was certainly
434
+ − 1252 hard to implement so instead of confusing you more by trying to explain
+ − 1253 it here, I'll just suggest you meditate over it for a while.
428
+ − 1254
+ − 1255 @deffn Widget choice
434
+ − 1256 Allows you to edit a sexp which may have one of a fixed set of types.
+ − 1257 It is currently implemented with the @code{choice-menu} basic widget,
+ − 1258 and has a similar syntax.
428
+ − 1259 @end deffn
+ − 1260
+ − 1261 @deffn Widget set
+ − 1262 Allows you to specify a type which must be a list whose elements all
+ − 1263 belong to given set. The elements of the list is not significant. This
+ − 1264 is implemented on top of the @code{checklist} basic widget, and has a
+ − 1265 similar syntax.
+ − 1266 @end deffn
+ − 1267
+ − 1268 @deffn Widget repeat
+ − 1269 Allows you to specify a variable length list whose members are all of
+ − 1270 the same type. Implemented on top of the `editable-list' basic widget,
+ − 1271 and has a similar syntax.
+ − 1272 @end deffn
+ − 1273
+ − 1274 @node Widget Properties, Defining New Widgets, Sexp Types, Top
+ − 1275 @comment node-name, next, previous, up
+ − 1276 @section Properties
+ − 1277
+ − 1278 You can examine or set the value of a widget by using the widget object
+ − 1279 that was returned by @code{widget-create}.
+ − 1280
+ − 1281 @defun widget-value widget
+ − 1282 Return the current value contained in @var{widget}.
+ − 1283 It is an error to call this function on an uninitialized widget.
+ − 1284 @end defun
+ − 1285
+ − 1286 @defun widget-value-set widget value
+ − 1287 Set the value contained in @var{widget} to @var{value}.
+ − 1288 It is an error to call this function with an invalid @var{value}.
+ − 1289 @end defun
+ − 1290
+ − 1291 @strong{Important:} You @emph{must} call @code{widget-setup} after
+ − 1292 modifying the value of a widget before the user is allowed to edit the
+ − 1293 widget again. It is enough to call @code{widget-setup} once if you
+ − 1294 modify multiple widgets. This is currently only necessary if the widget
+ − 1295 contains an editing field, but may be necessary for other widgets in the
+ − 1296 future.
+ − 1297
+ − 1298 If your application needs to associate some information with the widget
+ − 1299 objects, for example a reference to the item being edited, it can be
+ − 1300 done with @code{widget-put} and @code{widget-get}. The property names
+ − 1301 must begin with a @samp{:}.
+ − 1302
+ − 1303 @defun widget-put widget property value
+ − 1304 In @var{widget} set @var{property} to @var{value}.
+ − 1305 @var{property} should be a symbol, while @var{value} can be anything.
+ − 1306 @end defun
+ − 1307
+ − 1308 @defun widget-get widget property
+ − 1309 In @var{widget} return the value for @var{property}.
+ − 1310 @var{property} should be a symbol, the value is what was last set by
+ − 1311 @code{widget-put} for @var{property}.
+ − 1312 @end defun
+ − 1313
+ − 1314 @defun widget-member widget property
+ − 1315 Non-nil if @var{widget} has a value (even nil) for property @var{property}.
+ − 1316 @end defun
+ − 1317
+ − 1318 Occasionally it can be useful to know which kind of widget you have,
+ − 1319 i.e. the name of the widget type you gave when the widget was created.
+ − 1320
+ − 1321 @defun widget-type widget
+ − 1322 Return the name of @var{widget}, a symbol.
+ − 1323 @end defun
+ − 1324
+ − 1325 Widgets can be in two states: active, which means they are modifiable by
+ − 1326 the user, or inactive, which means they cannot be modified by the user.
+ − 1327 You can query or set the state with the following code:
+ − 1328
+ − 1329 @lisp
+ − 1330 ;; Examine if @var{widget} is active or not.
+ − 1331 (if (widget-apply @var{widget} :active)
+ − 1332 (message "Widget is active.")
+ − 1333 (message "Widget is inactive.")
+ − 1334
+ − 1335 ;; Make @var{widget} inactive.
+ − 1336 (widget-apply @var{widget} :deactivate)
+ − 1337
+ − 1338 ;; Make @var{widget} active.
+ − 1339 (widget-apply @var{widget} :activate)
+ − 1340 @end lisp
+ − 1341
434
+ − 1342 A widget is inactive if itself or any of its ancestors (found by
428
+ − 1343 following the @code{:parent} link) have been deactivated. To make sure
434
+ − 1344 a widget is really active, you must therefore activate both itself and
428
+ − 1345 all its ancestors.
+ − 1346
+ − 1347 @lisp
+ − 1348 (while widget
+ − 1349 (widget-apply widget :activate)
+ − 1350 (setq widget (widget-get widget :parent)))
+ − 1351 @end lisp
+ − 1352
+ − 1353 You can check if a widget has been made inactive by examining the value
434
+ − 1354 of the @code{:inactive} keyword. If this is non-nil, the widget itself
+ − 1355 has been deactivated. This is different from using the @code{:active}
+ − 1356 keyword, in that the latter tells you if the widget @strong{or} any of
+ − 1357 its ancestors have been deactivated. Do not attempt to set the
428
+ − 1358 @code{:inactive} keyword directly. Use the @code{:activate}
434
+ − 1359 @code{:deactivate} keywords instead.
428
+ − 1360
+ − 1361
+ − 1362 @node Defining New Widgets, Widget Browser, Widget Properties, Top
+ − 1363 @comment node-name, next, previous, up
+ − 1364 @section Defining New Widgets
+ − 1365
+ − 1366 You can define specialized widgets with @code{define-widget}. It allows
434
+ − 1367 you to create a shorthand for more complex widgets. This includes
+ − 1368 specifying component widgets and new default values for the keyword
+ − 1369 arguments.
428
+ − 1370
1183
+ − 1371 @defun define-widget name class doc &rest args
428
+ − 1372 Define a new widget type named @var{name} from @code{class}.
+ − 1373
+ − 1374 @var{name} and class should both be symbols, @code{class} should be one
+ − 1375 of the existing widget types.
+ − 1376
+ − 1377 The third argument @var{DOC} is a documentation string for the widget.
+ − 1378
434
+ − 1379 After the new widget has been defined the following two calls will
428
+ − 1380 create identical widgets:
+ − 1381
+ − 1382 @itemize @bullet
+ − 1383 @item
+ − 1384 @lisp
+ − 1385 (widget-create @var{name})
+ − 1386 @end lisp
+ − 1387
+ − 1388 @item
+ − 1389 @lisp
+ − 1390 (apply widget-create @var{class} @var{args})
+ − 1391 @end lisp
+ − 1392 @end itemize
+ − 1393
+ − 1394 @end defun
+ − 1395
1183
+ − 1396 Using @code{define-widget} just stores the definition of the widget type
434
+ − 1397 in the @code{widget-type} property of @var{name}, which is what
428
+ − 1398 @code{widget-create} uses.
+ − 1399
+ − 1400 If you just want to specify defaults for keywords with no complex
1339
+ − 1401 conversions, you can use @code{identity} as your @code{:convert-widget}
+ − 1402 function.
428
+ − 1403
+ − 1404 The following additional keyword arguments are useful when defining new
+ − 1405 widgets:
+ − 1406 @table @code
+ − 1407 @item :convert-widget
1339
+ − 1408 Method to convert type-specific components of a widget type before
+ − 1409 instantiating a widget of that type. Not normally called from user
+ − 1410 code, it is invoked by @code{widget-convert}. Typical operations
+ − 1411 include converting types of child widgets to widget instances and
+ − 1412 converting values from external format (@emph{i.e.}, as expected by the
+ − 1413 calling code) to internal format (which is often different for the
+ − 1414 convenience of widget manipulation). It takes a widget type as an
+ − 1415 argument, and returns the converted widget type. When a widget is
+ − 1416 created, the value of this property is called for the widget type, then
+ − 1417 for all the widget's parent types, most derived first. (The property is
+ − 1418 reevaluated for each parent type.)
428
+ − 1419
+ − 1420 The following predefined functions can be used here:
+ − 1421
+ − 1422 @defun widget-types-convert-widget widget
1339
+ − 1423 Convert each member of @code{:args} in @var{widget} from a widget type
+ − 1424 to a widget.
428
+ − 1425 @end defun
+ − 1426
+ − 1427 @defun widget-value-convert-widget widget
1339
+ − 1428 Initialize @code{:value} from @code{(car :args)} in @var{widget}, and
+ − 1429 reset @code{:args}.
428
+ − 1430 @end defun
+ − 1431
1339
+ − 1432 @item :copy
+ − 1433 A method to implement deep copying of the type. Any member of the
+ − 1434 widget which might be changed in place (rather than replaced) should be
+ − 1435 copied by this method. (@code{widget-copy} uses @code{copy-sequence} to
+ − 1436 ensure that the top-level list is a copy.) This particularly applies to
+ − 1437 child widgets.
+ − 1438
428
+ − 1439 @item :value-to-internal
+ − 1440 Function to convert the value to the internal format. The function
434
+ − 1441 takes two arguments, a widget and an external value. It returns the
428
+ − 1442 internal value. The function is called on the present @code{:value}
+ − 1443 when the widget is created, and on any value set later with
+ − 1444 @code{widget-value-set}.
+ − 1445
+ − 1446 @item :value-to-external
+ − 1447 Function to convert the value to the external format. The function
+ − 1448 takes two arguments, a widget and an internal value, and returns the
+ − 1449 internal value. The function is called on the present @code{:value}
+ − 1450 when the widget is created, and on any value set later with
+ − 1451 @code{widget-value-set}.
+ − 1452
+ − 1453 @item :create
+ − 1454 Function to create a widget from scratch. The function takes one
1339
+ − 1455 argument, a widget, and inserts it in the buffer. Not normally called
+ − 1456 from user code. Instead, call @code{widget-create} or related
+ − 1457 functions, which take a type argument, (usually) convert it to a widget,
+ − 1458 call the @code{:create} function to insert it in the buffer, and then
+ − 1459 return the (possibly converted) widget.
+ − 1460
+ − 1461 The default, @code{widget-default-create}, is invariably appropriate.
+ − 1462 (None of the standard widgets specify @code{:create}.)
428
+ − 1463
+ − 1464 @item :delete
+ − 1465 Function to delete a widget. The function takes one argument, a widget,
+ − 1466 and should remove all traces of the widget from the buffer.
+ − 1467
+ − 1468 @item :value-create
+ − 1469 Function to expand the @samp{%v} escape in the format string. It will
434
+ − 1470 be called with the widget as its argument and should insert a
+ − 1471 representation of the widget's value in the buffer.
428
+ − 1472
+ − 1473 @item :value-delete
434
+ − 1474 Should remove the representation of the widget's value from the buffer.
428
+ − 1475 It will be called with the widget as its argument. It doesn't have to
+ − 1476 remove the text, but it should release markers and delete nested widgets
434
+ − 1477 if such have been used.
428
+ − 1478
+ − 1479 The following predefined function can be used here:
+ − 1480
+ − 1481 @defun widget-children-value-delete widget
+ − 1482 Delete all @code{:children} and @code{:buttons} in @var{widget}.
+ − 1483 @end defun
+ − 1484
+ − 1485 @item :value-get
+ − 1486 Function to extract the value of a widget, as it is displayed in the
+ − 1487 buffer.
+ − 1488
+ − 1489 The following predefined function can be used here:
+ − 1490
+ − 1491 @defun widget-value-value-get widget
+ − 1492 Return the @code{:value} property of @var{widget}.
+ − 1493 @end defun
+ − 1494
+ − 1495 @item :format-handler
+ − 1496 Function to handle unknown @samp{%} escapes in the format string. It
+ − 1497 will be called with the widget and the escape character as arguments.
+ − 1498 You can set this to allow your widget to handle non-standard escapes.
+ − 1499
+ − 1500 You should end up calling @code{widget-default-format-handler} to handle
434
+ − 1501 unknown escape sequences. It will handle the @samp{%h} and any future
+ − 1502 escape sequences as well as give an error for unknown escapes.
428
+ − 1503
+ − 1504 @item :action
+ − 1505 Function to handle user initiated events. By default, @code{:notify}
652
+ − 1506 the parent. Actions normally do not include mere edits, but refer to
+ − 1507 things like invoking buttons or hitting enter in an editable field. To
+ − 1508 watch for any change, redefine the @code{:notify} callback.
428
+ − 1509
+ − 1510 The following predefined function can be used here:
+ − 1511
+ − 1512 @defun widget-parent-action widget &optional event
+ − 1513 Tell @code{:parent} of @var{widget} to handle the @code{:action}.@*
+ − 1514 Optional @var{event} is the event that triggered the action.
+ − 1515 @end defun
+ − 1516
+ − 1517 @item :prompt-value
+ − 1518 Function to prompt for a value in the minibuffer. The function should
+ − 1519 take four arguments, @var{widget}, @var{prompt}, @var{value}, and
+ − 1520 @var{unbound} and should return a value for widget entered by the user.
+ − 1521 @var{prompt} is the prompt to use. @var{value} is the default value to
434
+ − 1522 use, unless @var{unbound} is non-nil. In this case there is no default
428
+ − 1523 value. The function should read the value using the method most natural
434
+ − 1524 for this widget and does not have to check whether it matches.
428
+ − 1525 @end table
+ − 1526
+ − 1527 If you want to define a new widget from scratch, use the @code{default}
+ − 1528 widget as its base.
+ − 1529
+ − 1530 @deffn Widget default
+ − 1531 Widget used as a base for other widgets.
+ − 1532
+ − 1533 It provides most of the functionality that is referred to as ``by
+ − 1534 default'' in this text.
+ − 1535 @end deffn
+ − 1536
1339
+ − 1537 In implementing complex hierarchical widgets (@emph{e.g.}, using the
+ − 1538 @samp{group} widget), the following functions may be useful.
+ − 1539 The syntax for the @var{type} arguments to these functions is described
+ − 1540 in @ref{Basic Types}.
+ − 1541
+ − 1542 @defun widget-create-child-and-convert parent type &rest args
+ − 1543 As a child of @var{parent}, create a widget with type @var{type} and
1347
+ − 1544 value @var{value}. @var{type} is copied, and the @code{:widget-contvert}
1339
+ − 1545 method is applied to the optional keyword arguments from @var{args}.
+ − 1546 @end defun
+ − 1547
+ − 1548 @defun widget-create-child parent type
+ − 1549 As a child of @var{parent}, create a widget with type @var{type}.
1347
+ − 1550 @var{type} is copied, but no conversion method is applied.
1339
+ − 1551 @end defun
+ − 1552
+ − 1553 @defun widget-create-child-value parent type value
+ − 1554 As a child of @var{parent}, create a widget with type @var{type} and
1347
+ − 1555 value @var{value}. @var{type} is copied, but no conversion method is
1339
+ − 1556 applied.
+ − 1557 @end defun
+ − 1558
+ − 1559 @defun widget-convert type &rest args
+ − 1560 Convert @var{type} to a widget without inserting it in the buffer.
+ − 1561 The optional @var{args} are additional keyword arguments.
+ − 1562
+ − 1563 The widget's @code{:args} property is set from the longest tail of
+ − 1564 @var{args} whose @samp{cdr} is not a keyword, or if that is null, from
+ − 1565 the longest tail of @var{type}'s @code{:args} property whose cdr is not
+ − 1566 a keyword. Keyword arguments from @var{args} are set, and the
+ − 1567 @code{:value} property (if any) is converted from external to internal
+ − 1568 format.
+ − 1569 @end defun
+ − 1570
+ − 1571 @code{widget-convert} is typically not called from user code; rather it
+ − 1572 is called implicitly through the @samp{widget-create*} functions.
+ − 1573
428
+ − 1574 @node Widget Browser, Widget Minor Mode, Defining New Widgets, Top
+ − 1575 @comment node-name, next, previous, up
+ − 1576 @section Widget Browser
+ − 1577
+ − 1578 There is a separate package to browse widgets. This is intended to help
+ − 1579 programmers who want to examine the content of a widget. The browser
+ − 1580 shows the value of each keyword, but uses links for certain keywords
+ − 1581 such as `:parent', which avoids printing cyclic structures.
+ − 1582
+ − 1583 @deffn Command widget-browse WIDGET
+ − 1584 Create a widget browser for WIDGET.
+ − 1585 When called interactively, prompt for WIDGET.
+ − 1586 @end deffn
+ − 1587
+ − 1588 @deffn Command widget-browse-other-window WIDGET
+ − 1589 Create a widget browser for WIDGET and show it in another window.
+ − 1590 When called interactively, prompt for WIDGET.
+ − 1591 @end deffn
+ − 1592
+ − 1593 @deffn Command widget-browse-at POS
+ − 1594 Create a widget browser for the widget at POS.
+ − 1595 When called interactively, use the position of point.
+ − 1596 @end deffn
+ − 1597
+ − 1598 @node Widget Minor Mode, Utilities, Widget Browser, Top
+ − 1599 @comment node-name, next, previous, up
+ − 1600 @section Widget Minor Mode
+ − 1601
+ − 1602 There is a minor mode for manipulating widgets in major modes that
+ − 1603 doesn't provide any support for widgets themselves. This is mostly
+ − 1604 intended to be useful for programmers doing experiments.
+ − 1605
+ − 1606 @deffn Command widget-minor-mode
+ − 1607 Toggle minor mode for traversing widgets.
+ − 1608 With arg, turn widget mode on if and only if arg is positive.
+ − 1609 @end deffn
+ − 1610
+ − 1611 @defvar widget-minor-mode-keymap
+ − 1612 Keymap used in @code{widget-minor-mode}.
+ − 1613 @end defvar
+ − 1614
+ − 1615 @node Utilities, Widget Wishlist, Widget Minor Mode, Top
+ − 1616 @comment node-name, next, previous, up
+ − 1617 @section Utilities.
+ − 1618
+ − 1619 @defun widget-prompt-value widget prompt [ value unbound ]
+ − 1620 Prompt for a value matching @var{widget}, using @var{prompt}.@*
+ − 1621 The current value is assumed to be @var{value}, unless @var{unbound} is
+ − 1622 non-nil.@refill
+ − 1623 @end defun
+ − 1624
+ − 1625 @defun widget-get-sibling widget
+ − 1626 Get the item @var{widget} is assumed to toggle.@*
+ − 1627 This is only meaningful for radio buttons or checkboxes in a list.
+ − 1628 @end defun
+ − 1629
1183
+ − 1630 @node Widget Wishlist, Widget Internals, Utilities, Top
428
+ − 1631 @comment node-name, next, previous, up
+ − 1632 @section Wishlist
+ − 1633
+ − 1634 @itemize @bullet
+ − 1635 @item
+ − 1636 It should be possible to add or remove items from a list with @kbd{C-k}
+ − 1637 and @kbd{C-o} (suggested by @sc{rms}).
+ − 1638
+ − 1639 @item
+ − 1640 The @samp{[INS]} and @samp{[DEL]} buttons should be replaced by a single
+ − 1641 dash (@samp{-}). The dash should be a button that, when invoked, ask
+ − 1642 whether you want to add or delete an item (@sc{rms} wanted to git rid of
+ − 1643 the ugly buttons, the dash is my idea).
+ − 1644
+ − 1645 @item
+ − 1646 The @code{menu-choice} tag should be prettier, something like the abbreviated
+ − 1647 menus in Open Look.
+ − 1648
+ − 1649 @item
+ − 1650 Finish @code{:tab-order}.
+ − 1651
+ − 1652 @item
+ − 1653 Make indentation work with glyphs and proportional fonts.
+ − 1654
+ − 1655 @item
+ − 1656 Add commands to show overview of object and class hierarchies to the
+ − 1657 browser.
+ − 1658
+ − 1659 @item
+ − 1660 Find a way to disable mouse highlight for inactive widgets.
+ − 1661
+ − 1662 @item
+ − 1663 Find a way to make glyphs look inactive.
+ − 1664
+ − 1665 @item
+ − 1666 Add @code{property-list} widget.
+ − 1667
+ − 1668 @item
+ − 1669 Add @code{association-list} widget.
+ − 1670
+ − 1671 @item
+ − 1672 Add @code{key-binding} widget.
+ − 1673
+ − 1674 @item
+ − 1675 Add @code{widget} widget for editing widget specifications.
+ − 1676
+ − 1677 @item
+ − 1678 Find clean way to implement variable length list.
+ − 1679 See @code{TeX-printer-list} for an explanation.
+ − 1680
+ − 1681 @item
+ − 1682 @kbd{C-h} in @code{widget-prompt-value} should give type specific help.
+ − 1683
+ − 1684 @item
+ − 1685 A mailto widget.
+ − 1686
+ − 1687 @item
+ − 1688 @kbd{C-e e} in a fixed size field should go to the end of the text in
+ − 1689 the field, not the end of the field itself.
+ − 1690
+ − 1691 @item
1183
+ − 1692 Use an overlay instead of markers to delimit the widget. Create
428
+ − 1693 accessors for the end points.
+ − 1694
+ − 1695 @item
+ − 1696 Clicking on documentation links should call @code{describe-function} or
+ − 1697 @code{widget-browse-other-window} and friends directly, instead of going
+ − 1698 through @code{apropos}. If more than one function is valid for the
+ − 1699 symbol, it should pop up a menu.
+ − 1700
+ − 1701 @end itemize
+ − 1702
1183
+ − 1703 @node Widget Internals, , Widget Wishlist, Top
+ − 1704 @section Internals
+ − 1705
+ − 1706 This (very brief!) section provides a few notes on the internal
+ − 1707 structure and implementation of Emacs widgets. Avoid relying on this
+ − 1708 information. (We intend to improve it, but this will take some time.)
+ − 1709 To the extent that it actually describes APIs, the information will be
+ − 1710 moved to appropriate sections of the manual in due course.
+ − 1711
+ − 1712 @subsection The @dfn{Widget} and @dfn{Type} Structures
+ − 1713
+ − 1714 Widgets and types are currently both implemented as lists.
+ − 1715
+ − 1716 A symbol may be defined as a @dfn{type name} using @code{define-widget}.
+ − 1717 @xref{Defining New Widgets}. A @dfn{type} is a list whose car is a
+ − 1718 previously defined type name, nil, or (recursively) a type. The car is
+ − 1719 the @dfn{class} or parent type of the type, and properties which are not
+ − 1720 specified in the new type will be inherited from ancestors. Probably
+ − 1721 the only type without a class should be the @code{default} type. The
+ − 1722 cdr of a type is a plist whose keys are widget property keywords.
+ − 1723
+ − 1724 A type or type name may also be referred to as an @dfn{unconverted
+ − 1725 widget}.
+ − 1726
+ − 1727 A @dfn{converted widget} or @dfn{widget instance} is a list whose car is
+ − 1728 a type name or a type, and whose cdr is a property list. Furthermore,
+ − 1729 all children of the converted widget must be converted. Finally, in the
+ − 1730 process of appropriate parts of the list structure are copied to ensure
+ − 1731 that changes in values of one instance do not affect another's.
+ − 1732
428
+ − 1733 @contents
+ − 1734 @bye