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