341 |
(make-local-variable 'widget-example-repeat) |
(make-local-variable 'widget-example-repeat) |
342 |
(let ((inhibit-read-only t)) |
(let ((inhibit-read-only t)) |
343 |
(erase-buffer)) |
(erase-buffer)) |
344 |
|
(remove-overlays) |
345 |
(widget-insert "Here is some documentation.\n\nName: ") |
(widget-insert "Here is some documentation.\n\nName: ") |
346 |
(widget-create 'editable-field |
(widget-create 'editable-field |
347 |
:size 13 |
:size 13 |
681 |
@end deffn |
@end deffn |
682 |
|
|
683 |
@deffn{User Option} widget-glyph-enable |
@deffn{User Option} widget-glyph-enable |
684 |
If non-nil, allow glyphs to appear on displays where they are supported. |
If non-@code{nil}, allow glyphs to appear on displays where they are supported. |
685 |
@end deffn |
@end deffn |
686 |
|
|
687 |
|
|
814 |
@item :secret |
@item :secret |
815 |
Character used to display the value. You can set this to e.g.@: @code{?*} |
Character used to display the value. You can set this to e.g.@: @code{?*} |
816 |
if the field contains a password or other secret information. By |
if the field contains a password or other secret information. By |
817 |
default, this is nil, and the value is not secret. |
default, this is @code{nil}, and the value is not secret. |
818 |
|
|
819 |
@vindex valid-regexp@r{ keyword} |
@vindex valid-regexp@r{ keyword} |
820 |
@item :valid-regexp |
@item :valid-regexp |
866 |
|
|
867 |
@vindex case-fold@r{ keyword} |
@vindex case-fold@r{ keyword} |
868 |
@item :case-fold |
@item :case-fold |
869 |
Set this to nil if you don't want to ignore case when prompting for a |
Set this to @code{nil} if you don't want to ignore case when prompting for a |
870 |
choice through the minibuffer. |
choice through the minibuffer. |
871 |
|
|
872 |
@vindex children@r{ keyword} |
@vindex children@r{ keyword} |
873 |
@item :children |
@item :children |
874 |
A list whose @code{car} is the widget representing the currently chosen |
A list whose @sc{car} is the widget representing the currently chosen |
875 |
type in the buffer. |
type in the buffer. |
876 |
|
|
877 |
@vindex choice@r{ keyword} |
@vindex choice@r{ keyword} |
1065 |
@item :greedy |
@item :greedy |
1066 |
Usually a checklist will only match if the items are in the exact |
Usually a checklist will only match if the items are in the exact |
1067 |
sequence given in the specification. By setting @code{:greedy} to |
sequence given in the specification. By setting @code{:greedy} to |
1068 |
non-nil, it will allow the items to come in any sequence. However, if |
non-@code{nil}, it will allow the items to come in any sequence. |
1069 |
you extract the value they will be in the sequence given in the |
However, if you extract the value they will be in the sequence given |
1070 |
checklist, i.e.@: the original sequence is forgotten. |
in the checklist, i.e.@: the original sequence is forgotten. |
1071 |
|
|
1072 |
@vindex button-args@r{ keyword} |
@vindex button-args@r{ keyword} |
1073 |
@item :button-args |
@item :button-args |
1142 |
|
|
1143 |
@vindex args@r{ keyword} |
@vindex args@r{ keyword} |
1144 |
@item :args |
@item :args |
1145 |
List whose @code{car} is the type of the list elements. |
List whose @sc{car} is the type of the list elements. |
1146 |
@end table |
@end table |
1147 |
|
|
1148 |
@node group, , editable-list, Basic Types |
@node group, , editable-list, Basic Types |
1165 |
@section Sexp Types |
@section Sexp Types |
1166 |
@cindex sexp types |
@cindex sexp types |
1167 |
|
|
1168 |
A number of widgets for editing @dfn{s-expressions} (lisp types), sexp |
A number of widgets for editing @dfn{s-expressions} (Lisp types), sexp |
1169 |
for short, are also available. These basically fall in several |
for short, are also available. These basically fall in several |
1170 |
categories described in this section. |
categories described in this section. |
1171 |
|
|
1181 |
@subsection The Constant Widgets |
@subsection The Constant Widgets |
1182 |
@cindex constant widgets |
@cindex constant widgets |
1183 |
|
|
1184 |
The @code{const} widget can contain any lisp expression, but the user is |
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 |
prohibited from editing it, which is mainly useful as a component of one |
1186 |
of the composite widgets. |
of the composite widgets. |
1187 |
|
|
1218 |
@subsection Generic Sexp Widget |
@subsection Generic Sexp Widget |
1219 |
@cindex generic sexp widget |
@cindex generic sexp widget |
1220 |
|
|
1221 |
The @code{sexp} widget can contain any lisp expression, and allows the |
The @code{sexp} widget can contain any Lisp expression, and allows the |
1222 |
user to edit it inline in the buffer. |
user to edit it inline in the buffer. |
1223 |
|
|
1224 |
The syntax for the @code{sexp} widget is: |
The syntax for the @code{sexp} widget is: |
1279 |
@table @code |
@table @code |
1280 |
@vindex must-match@r{ keyword} |
@vindex must-match@r{ keyword} |
1281 |
@item :must-match |
@item :must-match |
1282 |
If this is set to non-nil, only existing file names will be allowed in |
If this is set to non-@code{nil}, only existing file names will be |
1283 |
the minibuffer. |
allowed in the minibuffer. |
1284 |
@end table |
@end table |
1285 |
@end deffn |
@end deffn |
1286 |
|
|
1290 |
@end deffn |
@end deffn |
1291 |
|
|
1292 |
@deffn Widget symbol |
@deffn Widget symbol |
1293 |
Allows you to edit a lisp symbol in an editable field. |
Allows you to edit a Lisp symbol in an editable field. |
1294 |
@end deffn |
@end deffn |
1295 |
|
|
1296 |
@deffn Widget function |
@deffn Widget function |
1310 |
@end deffn |
@end deffn |
1311 |
|
|
1312 |
@deffn Widget boolean |
@deffn Widget boolean |
1313 |
Allows you to edit a boolean. In lisp this means a variable which is |
Allows you to edit a boolean. In Lisp this means a variable which is |
1314 |
either nil meaning false, or non-nil meaning true. |
either @code{nil} meaning false, or non-@code{nil} meaning true. |
1315 |
@end deffn |
@end deffn |
1316 |
|
|
1317 |
|
|
1331 |
will be displayed in the buffer, and will be editable by the user. |
will be displayed in the buffer, and will be editable by the user. |
1332 |
|
|
1333 |
@deffn Widget cons |
@deffn Widget cons |
1334 |
The value of a @code{cons} widget is a cons-cell where the @code{car} is |
The value of a @code{cons} widget is a cons-cell where the @sc{car} is |
1335 |
the value of the first component and the @code{cdr} is the value of the |
the value of the first component and the @sc{cdr} is the value of the |
1336 |
second component. There must be exactly two components. |
second component. There must be exactly two components. |
1337 |
@end deffn |
@end deffn |
1338 |
|
|
1433 |
@end defun |
@end defun |
1434 |
|
|
1435 |
@defun widget-member widget property |
@defun widget-member widget property |
1436 |
Non-nil if @var{widget} has a value (even nil) for property @var{property}. |
Non-@code{nil} if @var{widget} has a value (even @code{nil}) for |
1437 |
|
property @var{property}. |
1438 |
@end defun |
@end defun |
1439 |
|
|
1440 |
Occasionally it can be useful to know which kind of widget you have, |
Occasionally it can be useful to know which kind of widget you have, |
1477 |
@end lisp |
@end lisp |
1478 |
|
|
1479 |
You can check if a widget has been made inactive by examining the value |
You can check if a widget has been made inactive by examining the value |
1480 |
of the @code{:inactive} keyword. If this is non-nil, the widget itself |
of the @code{:inactive} keyword. If this is non-@code{nil}, the widget itself |
1481 |
has been deactivated. This is different from using the @code{:active} |
has been deactivated. This is different from using the @code{:active} |
1482 |
keyword, in that the latter tells you if the widget @strong{or} any of |
keyword, in that the latter tells you if the widget @strong{or} any of |
1483 |
its ancestors have been deactivated. Do not attempt to set the |
its ancestors have been deactivated. Do not attempt to set the |
1502 |
@var{name} and class should both be symbols, @code{class} should be one |
@var{name} and class should both be symbols, @code{class} should be one |
1503 |
of the existing widget types. |
of the existing widget types. |
1504 |
|
|
1505 |
The third argument @var{DOC} is a documentation string for the widget. |
The third argument @var{doc} is a documentation string for the widget. |
1506 |
|
|
1507 |
After the new widget has been defined, the following two calls will |
After the new widget has been defined, the following two calls will |
1508 |
create identical widgets: |
create identical widgets: |
1655 |
take four arguments, @var{widget}, @var{prompt}, @var{value}, and |
take four arguments, @var{widget}, @var{prompt}, @var{value}, and |
1656 |
@var{unbound} and should return a value for widget entered by the user. |
@var{unbound} and should return a value for widget entered by the user. |
1657 |
@var{prompt} is the prompt to use. @var{value} is the default value to |
@var{prompt} is the prompt to use. @var{value} is the default value to |
1658 |
use, unless @var{unbound} is non-nil, in which case there is no default |
use, unless @var{unbound} is non-@code{nil}, in which case there is no default |
1659 |
value. The function should read the value using the method most natural |
value. The function should read the value using the method most natural |
1660 |
for this widget, and does not have to check that it matches. |
for this widget, and does not have to check that it matches. |
1661 |
@end table |
@end table |
1721 |
@defun widget-prompt-value widget prompt [ value unbound ] |
@defun widget-prompt-value widget prompt [ value unbound ] |
1722 |
Prompt for a value matching @var{widget}, using @var{prompt}. |
Prompt for a value matching @var{widget}, using @var{prompt}. |
1723 |
The current value is assumed to be @var{value}, unless @var{unbound} is |
The current value is assumed to be @var{value}, unless @var{unbound} is |
1724 |
non-nil.@refill |
non-@code{nil}.@refill |
1725 |
@end defun |
@end defun |
1726 |
|
|
1727 |
@defun widget-get-sibling widget |
@defun widget-get-sibling widget |