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