annotate lispref/customize.texi @ 21372:fbb2f87ce945

Fix previous change.
author Richard M. Stallman <rms@gnu.org>
date Sun, 05 Apr 1998 19:13:50 +0000
parents 00022857f529
children 90da2489c498
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
21006
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1 @c -*-texinfo-*-
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2 @c This is part of the GNU Emacs Lisp Reference Manual.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3 @c Copyright (C) 1997, 1998 Free Software Foundation, Inc.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4 @c See the file elisp.texi for copying conditions.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5 @setfilename ../info/customize
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6 @node Customization, Loading, Macros, Top
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
7 @chapter Writing Customization Definitions
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
8
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
9 This chapter describes how to declare customization groups, variables,
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
10 and faces. We use the term @dfn{customization item} to include all
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11 three of those. This has few examples, but please look at the file
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
12 @file{cus-edit.el}, which contains many declarations you can learn from.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
13
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
14 @menu
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
15 * Common Keywords::
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16 * Group Definitions::
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
17 * Variable Definitions::
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
18 * Face Definitions::
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
19 * Customization Types::
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
20 @end menu
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
21
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
22 @node Common Keywords
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
23 @section Common Keywords for All Kinds of Items
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
24
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
25 All three kinds of customization declarations (for groups, variables,
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
26 and faces) accept keyword arguments for specifying various information.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
27 This section describes some keywords that apply to all three.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
28
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
29 All of these keywords, except @code{:tag}, can be used more than once in
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
30 a given item. Each use of the keyword has an independent effect. The
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
31 keyword @code{:tag} is an exception because any given item can only
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32 display one name item.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
33
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
34 @table @code
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
35 @item :group @var{group}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
36 Put this customization item in group @var{group}. When you use
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
37 @code{:group} in a @code{defgroup}, it makes the new group a subgroup of
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
38 @var{group}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
39
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
40 If you use this keyword more than once, you can put a single item into
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
41 more than one group. Displaying any of those groups will show this
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
42 item. Be careful not to overdo this!
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
43
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
44 @item :link @var{link-data}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
45 Include an external link after the documentation string for this item.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
46 This is a sentence containing an active field which references some
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
47 other documentation.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
48
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
49 There are three alternatives you can use for @var{link-data}:
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
50
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
51 @table @code
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
52 @item (custom-manual @var{info-node})
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
53 Link to an Info node; @var{info-node} is a string which specifies the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
54 node name, as in @code{"(emacs)Top"}. The link appears as
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
55 @samp{[manual]} in the customization buffer.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
56
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
57 @item (info-link @var{info-node})
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
58 Like @code{custom-manual} except that the link appears
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
59 in the customization buffer with the Info node name.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
60
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
61 @item (url-link @var{url})
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
62 Link to a web page; @var{url} is a string which specifies the URL. The
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
63 link appears in the customization buffer as @var{url}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
64 @end table
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
65
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
66 You can specify the text to use in the customization buffer by adding
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
67 @code{:tag @var{name}} after the first element of the @var{link-data};
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
68 for example, @code{(info-link :tag "foo" "(emacs)Top")} makes a link to
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
69 the Emacs manual which appears in the buffer as @samp{foo}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
70
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
71 An item can have more than one external link; however, most items have
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
72 none at all.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
73
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
74 @item :load @var{file}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
75 Load file @var{file} (a string) before displaying this customization
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
76 item. Loading is done with @code{load-library}, and only if the file is
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
77 not already loaded.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
78
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
79 @item :require @var{feature}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
80 Require feature @var{feature} (a symbol) when installing a value for
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
81 this item (an option or a face) that was saved using the customization
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
82 feature. This is done by calling @code{require}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
83
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
84 The most common reason to use @code{:require} is when a variable enables
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
85 a feature such as a minor mode, and just setting the variable won't have
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
86 any effect unless the code which implements the mode is loaded.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
87
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
88 @item :tag @var{name}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
89 Use @var{name}, a string, instead of the item's name, to label the item
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
90 in customization menus and buffers.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
91 @end table
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
92
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
93 @node Group Definitions
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
94 @section Defining Custom Groups
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
95
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
96 Each Emacs Lisp package should have one main customization group which
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
97 contains all the options, faces and other groups in the package. If the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
98 package has a small number of options and faces, use just one group and
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
99 put everything in it. When there are more than twelve or so options and
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
100 faces, then you should structure them into subgroups, and put the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
101 subgroups under the package's main customization group. It is ok to
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
102 have some of the options and faces in the package's main group alongside
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
103 the subgroups.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
104
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
105 The package's main or only group should be a member of one or more of
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
106 the standard customization groups. Type press @kbd{C-h p} to display a
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
107 list of finder keywords; them choose some of them add your group to each
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
108 of them, using the @code{:group} keyword.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
109
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
110 The way to declare new customization groups is with @code{defgroup}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
111
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
112 @tindex defgroup
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
113 @defmac defgroup group members doc [keyword value]...
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
114 Declare @var{group} as a customization group containing @var{members}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
115 Do not quote the symbol @var{group}. The argument @var{doc} specifies
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
116 the documentation string for the group.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
117
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
118 The arguments @var{members} can be an alist whose elements specify
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
119 members of the group; however, normally @var{members} is @code{nil}, and
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
120 you specify the group's members by using the @code{:group} keyword when
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
121 defining those members.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
122
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
123 @ignore
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
124 @code{(@var{name} @var{widget})}. Here @var{name} is a symbol, and
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
125 @var{widget} is a widget for editing that symbol. Useful widgets are
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
126 @code{custom-variable} for editing variables, @code{custom-face} for
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
127 editing faces, and @code{custom-group} for editing groups.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
128 @end ignore
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
129
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
130 In addition to the common keywords (@pxref{Common Keywords}), you can
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
131 use this keyword in @code{defgroup}:
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
132
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
133 @table @code
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
134 @item :prefix @var{prefix}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
135 If the name of an item in the group starts with @var{prefix}, then the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
136 tag for that item is constructed (by default) by omitting @var{prefix}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
137
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
138 One group can have any number of prefixes.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
139 @end table
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
140 @end defmac
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
141
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
142 The @code{:prefix} feature is currently turned off, which means that
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
143 @code{:prefix} currently has no effect. We did this because we found
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
144 that discarding the specified prefixes often led to confusing names for
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
145 options. This happened because the people who wrote the @code{defgroup}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
146 definitions for various groups added @code{:prefix} keywords whenever
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
147 they make logical sense---that is, whenever they say that there was a
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
148 common prefix for the option names in a library.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
149
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
150 In order to obtain good results with @code{:prefix}, it is necessary to
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
151 check the specific effects of discarding a particular prefix, given the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
152 specific items in a group and their names and documentation. If the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
153 resulting text is not clear, then @code{:prefix} should not be used in
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
154 that case.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
155
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
156 It should be possible to recheck all the customization groups, delete
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
157 the @code{:prefix} specifications which give unclear results, and then
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
158 turn this feature back on, if someone would like to do the work.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
159
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
160 @node Variable Definitions
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
161 @section Defining Customization Variables
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
162
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
163 Use @code{defcustom} to declare user editable variables.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
164
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
165 @tindex defcustom
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
166 @defmac defcustom option value doc [keyword value]...
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
167 Declare @var{option} as a customizable user option variable that
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
168 defaults to @var{value}. Do not quote @var{option}. @var{value} should
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
169 be an expression to compute the value; it will be be evaluated on more
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
170 than one occasion.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
171
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
172 If @var{option} is void, @code{defcustom} initializes it to @var{value}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
173
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
174 The argument @var{doc} specifies the documentation string for the variable.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
175
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
176 The following additional keywords are defined:
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
177
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
178 @table @code
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
179 @item :type @var{type}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
180 Use @var{type} as the data type for this option. It specifies which
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
181 values are legitimate, and how to display the value.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
182 @xref{Customization Types}, for more information.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
183
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
184 @item :options @var{list}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
185 Specify @var{list} as the list of reasonable values for use in this
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
186 option.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
187
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
188 Currently this is meaningful only when type is @code{hook}. The
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
189 elements of @var{list} are functions that you might likely want to use
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
190 as elements of the hook value. The user is not actually restricted to
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
191 using only these functions, but they are offered as convenient
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
192 alternatives.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
193
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
194 @item :version @var{version}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
195 This option specifies that the variable's default value was changed in
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
196 Emacs version @var{version}. For example,
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
197
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
198 @example
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
199 (defcustom foo-max 34
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
200 "*Maximum number of foo's allowed."
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
201 :type 'integer
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
202 :group 'foo
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
203 :version "20.3")
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
204 @end example
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
205
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
206 @item :set @var{setfunction}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
207 Specify @var{setfunction} as the way to change the value of this option.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
208 The function @var{setfunction} should take two arguments, a symbol and
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
209 the new value, and should do whatever is necessary to update the value
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
210 properly for this option (which may not mean simply setting the option
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
211 as a Lisp variable). The default for @var{setfunction} is
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
212 @code{set-default}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
213
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
214 @item :get @var{getfunction}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
215 Specify @var{getfunction} as the way to extract the value of this
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
216 option. The function @var{getfunction} should take one argument, a
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
217 symbol, and should return the ``current value'' for that symbol (which
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
218 need not be the symbol's Lisp value). The default is
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
219 @code{default-value}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
220
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
221 @item :initialize @var{function}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
222 @var{function} should be a function used to initialize the variable when
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
223 the @code{defcustom} is evaluated. It should take two arguments, the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
224 symbol and value. Here are some predefined functions meant for use in
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
225 this way:
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
226
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
227 @table @code
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
228 @item custom-initialize-set
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
229 Use the variable's @code{:set} function to initialize the variable. Do
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
230 not reinitialize it if it is already non-void. This is the default
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
231 @code{:initialize} function.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
232
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
233 @item custom-initialize-default
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
234 Always use @code{set-default} to initialize the variable, even if some
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
235 other @code{:set} function has been specified.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
236
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
237 @item custom-initialize-reset
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
238 Even if the variable is already non-void, reset it by calling the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
239 @code{:set} function using the current value (returned by the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
240 @code{:get} method).
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
241
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
242 @item custom-initialize-changed
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
243 Like @code{custom-initialize-reset}, except use @code{set-default}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
244 (rather than the @code{:set} function) to initialize the variable if it
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
245 is not bound and has not been set already.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
246 @end table
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
247
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
248 @item :require @var{feature}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
249 If the user saves a customized value for this item, them Emacs should do
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
250 @code{(require @var{feature})} after installing the saved value.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
251
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
252 The place to use this feature is for an option that turns on the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
253 operation of a certain feature. Assuming that the package is coded to
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
254 check the value of the option, you still need to arrange for the package
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
255 to be loaded. That is what @code{:require} is for.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
256 @end table
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
257 @end defmac
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
258
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
259 @ignore
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
260 Use @code{custom-add-option} to specify that a specific function is
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
261 useful as an member of a hook.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
262
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
263 @defun custom-add-option symbol option
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
264 To the variable @var{symbol} add @var{option}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
265
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
266 If @var{symbol} is a hook variable, @var{option} should be a hook
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
267 member. For other types variables, the effect is undefined."
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
268 @end defun
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
269 @end ignore
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
270
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
271 Internally, @code{defcustom} uses the symbol property
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
272 @code{standard-value} to record the expression for the default value,
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
273 and @code{saved-value} to record the value saved by the user with the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
274 customization buffer. The @code{saved-value} property is actually a
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
275 list whose car is an expression which evaluates to the value.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
276
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
277 @node Face Definitions
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
278 @section Defining Faces
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
279
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
280 Faces are declared with @code{defface}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
281
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
282 @tindex defface
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
283 @defmac defface face spec doc [keyword value]...
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
284 Declare @var{face} as a customizable face that defaults according to
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
285 @var{spec}. Do not quote the symbol @var{face}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
286
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
287 @var{doc} is the face documentation.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
288
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
289 @var{spec} should be an alist whose elements have the form
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
290 @code{(@var{display} @var{atts})} (see below). When @code{defface}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
291 executes, it defines the face according to @var{spec}, then uses any
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
292 customizations saved in the @file{.emacs} file to override that
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
293 specification.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
294
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
295 In each element of @var{spec}, @var{atts} is a list of face attributes
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
296 and their values. The possible attributes are defined in the variable
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
297 @code{custom-face-attributes}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
298
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
299 The @var{display} part of an element of @var{spec} determines which
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
300 frames the element applies to. If more than one element of @var{spec}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
301 matches a given frame, the first matching element is the only one used
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
302 for that frame.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
303
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
304 If @var{display} is @code{t} in a @var{spec} element, that element
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
305 matches all frames. (This means that any subsequent elements of
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
306 @var{spec} are never used.)
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
307
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
308 Alternatively, @var{display} can be an alist whose elements have the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
309 form @code{(@var{characteristic} @var{value}@dots{})}. Here
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
310 @var{characteristic} specifies a way of classifying frames, and the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
311 @var{value}s are possible classifications which @var{display} should
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
312 apply to. Here are the possible values of @var{characteristic}:
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
313
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
314 @table @code
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
315 @item type
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
316 The kind of window system the frame uses---either @code{x}, @code{pc}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
317 (for the MS-DOS console), @code{w32} (for MS Windows 9X/NT), or
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
318 @code{tty}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
319
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
320 @item class
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
321 What kinds of colors the frame supports---either @code{color},
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
322 @code{grayscale}, or @code{mono}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
323
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
324 @item background
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
325 The kind of background--- either @code{light} or @code{dark}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
326 @end table
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
327
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
328 If an element of @var{display} specifies more than one
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
329 @var{value} for a given @var{characteristic}, any of those values
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
330 is acceptable. If an element of @var{display} has elements for
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
331 more than one @var{characteristic}, then @var{each} characteristic
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
332 of the frame must match one of the values specified for it.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
333 @end defmac
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
334
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
335 Internally, @code{defface} uses the symbol property
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
336 @code{face-defface-spec} to record the face attributes specified in
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
337 @code{defface}, @code{saved-face} for the attributes saved by the user
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
338 with the customization buffer, and @code{face-documentation} for the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
339 documentation string.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
340
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
341 @node Customization Types
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
342 @section Customization Types
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
343
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
344 When you define a user option with @code{defcustom}, you must specify
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
345 its @dfn{customization type}. That is a Lisp object which indictaes (1)
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
346 which values are legitimate and (2) how to display the value in the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
347 customization buffer for editing.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
348
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
349 You specify the customization type in @code{defcustom} with the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
350 @code{:type} keyword. The argument of @code{:type} is evaluated; since
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
351 types that vary at run time are rarely useful, normally it is a quoted
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
352 constant. For example:
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
353
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
354 @example
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
355 (defcustom diff-command "diff"
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
356 "*The command to use to run diff."
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
357 :type 'string
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
358 :group 'diff)
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
359 @end example
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
360
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
361 In general, a customization type appears is a list whose first element
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
362 is a symbol, one of the customization type names defined in the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
363 following sections. After this symbol come a number of arguments,
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
364 depending on the symbol. Some of the type symbols do not use any
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
365 arguments; those are called @dfn{simple types}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
366
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
367 In between the type symbol and its arguments, you can optionally
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
368 write keyword-value pairs. @xref{Type Keywords}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
369
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
370 For a simple type, if you do not use any keyword-value pairs, you can
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
371 omit the parentheses around the type symbol. The above example does
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
372 this, using just @code{string} as the customization type.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
373 But @code{(string)} would mean the same thing.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
374
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
375 @menu
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
376 * Simple Types::
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
377 * Composite Types::
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
378 * Splicing into Lists::
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
379 * Type Keywords::
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
380 @end menu
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
381
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
382 @node Simple Types
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
383 @subsection Simple Types
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
384
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
385 This section describes all the simple customization types.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
386
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
387 @table @code
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
388 @item sexp
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
389 The value may be any Lisp object that can be printed and read back. You
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
390 can use @code{sexp} as a fall-back for any option, if you don't want to
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
391 take the time to work out a more specific type to use.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
392
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
393 @item integer
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
394 The value must be an integer, and is represented textually
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
395 in the customization buffer.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
396
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
397 @item number
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
398 The value must be a number, and is represented textually in the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
399 customization buffer.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
400
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
401 @item string
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
402 The value must be a string, and the customization buffer shows just the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
403 contents, with no @samp{"} characters or quoting with @samp{\}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
404
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
405 @item regexp
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
406 The value must be a string which is a valid regular expression.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
407
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
408 @item character
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
409 The value must be a character code. A character code is actually an
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
410 integer, but this type shows the value by inserting the character in the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
411 buffer, rather than by showing the number.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
412
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
413 @item file
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
414 The value must be a file name, and you can do completion with
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
415 @kbd{M-@key{TAB}}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
416
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
417 @item (file :must-match t)
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
418 The value must be a file name for an existing file, and you can do
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
419 completion with @kbd{M-@key{TAB}}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
420
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
421 @item directory
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
422 The value must be a directory name, and you can do completion with
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
423 @kbd{M-@key{TAB}}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
424
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
425 @item symbol
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
426 The value must be a symbol. It appears in the customization buffer as
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
427 the name of the symbol.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
428
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
429 @item function
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
430 The value must be either a lambda expression or a function name. When
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
431 it is a function name, you can do completion with @kbd{M-@key{TAB}}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
432
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
433 @item variable
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
434 The value must be a variable name, and you can do completion with
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
435 @kbd{M-@key{TAB}}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
436
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
437 @item boolean
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
438 The value is boolean---either @code{nil} or @code{t}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
439 @end table
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
440
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
441 @node Composite Types
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
442 @subsection Composite Types
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
443
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
444 When none of the simple types is appropriate, you can use composite
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
445 types, which build from simple types. Here are several ways of doing
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
446 that:
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
447
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
448 @table @code
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
449 @item (restricted-sexp :match-alternatives @var{criteria})
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
450 The value may be any Lisp object that satisfies one of @var{criteria}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
451 @var{criteria} should be a list, and each elements should be
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
452 one of these possibilities:
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
453
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
454 @itemize @bullet
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
455 @item
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
456 A predicate---that is, a function of one argument that returns non-@code{nil}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
457 if the argument fits a certain type. This means that objects of that type
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
458 are acceptable.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
459
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
460 @item
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
461 A quoted constant---that is, @code{'@var{object}}. This means that
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
462 @var{object} is an acceptable value.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
463 @end itemize
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
464
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
465 For example,
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
466
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
467 @example
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
468 (restricted-sexp :match-alternatives (integerp 't 'nil))
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
469 @end example
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
470
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
471 @noindent
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
472 allows integers, @code{t} and @code{nil} as legitimate values.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
473
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
474 The customization buffer shows all legitimate values using their read
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
475 syntax, and the user edits them textually.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
476
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
477 @item (cons @var{car-type} @var{cdr-type})
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
478 The value must be a cons cell, its @sc{car} must fit @var{car-type}, and
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
479 its @sc{cdr} must fit @var{cdr-type}. For example, @code{(const string
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
480 symbol)} is a customization type which matches values such as
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
481 @code{("foo" . foo)}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
482
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
483 In the customization buffeer, the @sc{car} and the @sc{cdr} are
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
484 displayed and edited separately, each according to the type
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
485 that you specify for it.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
486
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
487 @item (list @var{element-types}@dots{})
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
488 The value must be a list with exactly as many elements as the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
489 @var{element-types} you have specified; and each element must fit the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
490 corresponding @var{element-type}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
491
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
492 For example, @code{(list integer string function)} describes a list of
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
493 three elements; the first element must be an integer, the second a
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
494 string, and the third a function.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
495
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
496 In the customization buffeer, the each element is displayed and edited
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
497 separately, according to the type specified for it.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
498
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
499 @item (vector @var{element-types}@dots{})
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
500 Like @code{list} except that the value must be a vector instead of a
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
501 list. The elements work the same as in @code{list}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
502
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
503 @item (choice @var{alternative-types}...)
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
504 The value must fit at least one of @var{alternative-types}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
505 For example, @code{(choice integer string)} allows either an
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
506 integer or a string.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
507
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
508 In the customization buffer, the user selects one of the alternatives
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
509 using a menu, and can then edit the value in the usual way for that
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
510 alternative.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
511
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
512 Normally the strings in this menu are determined automatically from the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
513 choices; however, you can specify different strings for the menu by
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
514 including the @code{:tag} keyword in the alternatives. For example, if
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
515 an integer stands for a number of spaces, while a string is text to use
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
516 verbatim, you might write the customization type this way,
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
517
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
518 @smallexample
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
519 (choice (integer :tag "Number of spaces")
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
520 (string :tag "Literal text"))
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
521 @end smallexample
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
522
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
523 @noindent
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
524 so that the menu offers @samp{Number of spaces} and @samp{Literal Text}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
525
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
526 @item (const @var{value})
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
527 The value must be @var{value}---nothing else is allowed.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
528
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
529 The main use of @code{const} is inside of @code{choice}. For example,
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
530 @code{(choice integer (const nil))} allows either an integer or
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
531 @code{nil}. @code{:tag} is often used with @code{const}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
532
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
533 @item (function-item @var{function})
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
534 Like @code{const}, but used for values which are functions. This
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
535 displays the documentation string of the function @var{function}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
536 as well as its name.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
537
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
538 @item (variable-item @var{variable})
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
539 Like @code{const}, but used for values which are variable names. This
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
540 displays the documentation string of the variable @var{variable} as well
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
541 as its name.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
542
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
543 @item (set @var{elements}@dots{})
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
544 The value must be a list and each element of the list must be one of the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
545 @var{elements} specified. This appears in the customization buffer as a
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
546 checklist.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
547
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
548 @item (repeat @var{element-type})
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
549 The value must be a list and each element of the list must fit the type
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
550 @var{element-type}. This appears in the customization buffer as a
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
551 list of elements, with @samp{[INS]} and @samp{[DEL]} buttons for adding
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
552 more elements or removing elements.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
553 @end table
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
554
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
555 @node Splicing into Lists
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
556 @subsection Splicing into Lists
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
557
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
558 The @code{:inline} feature lets you splice a variable number of
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
559 elements into the middle of a list or vector. You use it in a
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
560 @code{set}, @code{choice} or @code{repeat} type which appears among the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
561 element-types of a @code{list} or @code{vector}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
562
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
563 Normally, each of the element-types in a @code{list} or @code{vector}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
564 describes one and only one element of the list or vector. Thus, if an
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
565 element-type is a @code{repeat}, that specifies a list of unspecified
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
566 length which appears as one element.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
567
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
568 But when the element-type uses @code{:inline}, the value it matches is
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
569 merged directly into the containing sequence. For example, if it
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
570 matches a list with three elements, those become three elements of the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
571 overall sequence. This is analogous to using @samp{,@@} in the backquote
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
572 construct.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
573
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
574 For example, to specify a list whose first element must be @code{t}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
575 and whose remaining arguments should be zero or more of @code{foo} and
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
576 @code{bar}, use this customization type:
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
577
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
578 @example
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
579 (list (const t) (set :inline t foo bar))
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
580 @end example
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
581
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
582 @noindent
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
583 This matches values such as @code{(t)}, @code{(t foo)}, @code{(t bar)}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
584 and @code{(t foo bar)}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
585
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
586 When the element-type is a @code{choice}, you use @code{:inline} not
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
587 in the @code{choice} itself, but in (some of) the alternatives of the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
588 @code{choice}. For example, to match a list which must start with a
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
589 file name, followed either by the symbol @code{t} or two strings, use
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
590 this customization type:
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
591
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
592 @example
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
593 (list file
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
594 (choice (const t)
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
595 (list :inline t string string)))
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
596 @end example
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
597
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
598 @noindent
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
599 If the user chooses the first alternative in the choice, then the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
600 overall list has two elements and the second element is @code{t}. If
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
601 the user chooses the second alternative, then the overall list has three
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
602 elements and the second and third must be strings.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
603
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
604 @node Type Keywords
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
605 @subsection Type Keywords
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
606
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
607 You can specify keyword-argument pairs in a customization type after the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
608 type name symbol. Here are the keywords you can use, and their
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
609 meanings:
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
610
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
611 @table @code
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
612 @item :value @var{default}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
613 This is used for a type that appears as an alternative inside of
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
614 @code{:choice}; it specifies the default value to use, at first, if and
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
615 when the user selects this alternative with the menu in the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
616 customization buffer.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
617
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
618 Of course, if the actual value of the option fits this alternative, it
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
619 will appear showing the actual value, not @var{default}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
620
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
621 @item :format @var{format-string}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
622 This string will be inserted in the buffer to represent the value
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
623 corresponding to the type. The following @samp{%} escapes are available
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
624 for use in @var{format-string}:
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
625
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
626 @table @samp
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
627 @ignore
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
628 @item %[@var{button}%]
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
629 Display the text @var{button} marked as a button. The @code{:action}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
630 attribute specifies what the button will do if the user invokes it;
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
631 its value is a function which takes two arguments---the widget which
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
632 the button appears in, and the event.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
633
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
634 There is no way to specify two different buttons with different
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
635 actions; but perhaps there is no need for one.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
636 @end ignore
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
637
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
638 @item %@{@var{sample}%@}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
639 Show @var{sample} in a special face specified by @code{:sample-face}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
640
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
641 @item %v
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
642 Substitute the item's value. How the value is represented depends on
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
643 the kind of item, and (for variables) on the customization type.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
644
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
645 @item %d
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
646 Substitute the item's documentation string.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
647
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
648 @item %h
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
649 Like @samp{%d}, but if the documentation string is more than one line,
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
650 add an active field to control whether to show all of it or just the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
651 first line.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
652
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
653 @item %t
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
654 Substitute the tag here. You specify the tag with the @code{:tag}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
655 keyword.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
656
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
657 @item %%
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
658 Display a literal @samp{%}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
659 @end table
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
660
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
661 @item :button-face @var{face}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
662 Use face @var{face} for text displayed with @samp{%[@dots{}%]}.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
663
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
664 @item :button-prefix
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
665 @itemx :button-suffix
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
666 These specify the text to display before and after a button.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
667 Each can be:
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
668
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
669 @table @asis
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
670 @item @code{nil}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
671 No text is inserted.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
672
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
673 @item a string
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
674 The string is inserted literally.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
675
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
676 @item a symbol
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
677 The symbol's value is used.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
678 @end table
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
679
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
680 @item :doc @var{doc}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
681 Use @var{doc} as the documentation string for this item.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
682
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
683 @item :tag @var{tag}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
684 Use @var{tag} (a string) as the tag for this item.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
685
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
686 @item :help-echo @var{motion-doc}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
687 When you move to this item with @code{widget-forward} or
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
688 @code{widget-backward}, it will display the string @var{motion-doc}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
689 in the echo area.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
690
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
691 @item :match @var{function}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
692 Specify how to decide whether a value matches the type. @var{function}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
693 should be a function that accepts two arguments, a widget and a value;
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
694 it should return non-@code{nil} if the value is acceptable.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
695
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
696 @ignore
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
697 @item :indent @var{columns}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
698 Indent this item by @var{columns} columns. The indentation is used for
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
699 @samp{%n}, and automatically for group names, for checklists and radio
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
700 buttons, and for editable lists. It affects the whole of the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
701 item except for the first line.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
702
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
703 @item :offset @var{columns}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
704 An integer indicating how many extra spaces to indent the subitems of
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
705 this item. By default, subitems are indented the same as their parent.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
706
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
707 @item :extra-offset
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
708 An integer indicating how many extra spaces to add to this item's
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
709 indentation, compared to its parent.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
710
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
711 @item :notify
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
712 A function called each time the item or a subitem is changed. The
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
713 function is called with two or three arguments. The first argument is
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
714 the item itself, the second argument is the item that was changed, and
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
715 the third argument is the event leading to the change, if any.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
716
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
717 @item :menu-tag
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
718 Tag used in the menu when the widget is used as an option in a
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
719 @code{menu-choice} widget.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
720
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
721 @item :menu-tag-get
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
722 Function used for finding the tag when the widget is used as an option
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
723 in a @code{menu-choice} widget. By default, the tag used will be either the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
724 @code{:menu-tag} or @code{:tag} property if present, or the @code{princ}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
725 representation of the @code{:value} property if not.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
726
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
727 @item :validate
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
728 A function which takes a widget as an argument, and return nil if the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
729 widgets current value is valid for the widget. Otherwise, it should
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
730 return the widget containing the invalid data, and set that widgets
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
731 @code{:error} property to a string explaining the error.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
732
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
733 You can use the function @code{widget-children-validate} for this job;
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
734 it tests that all children of @var{widget} are valid.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
735
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
736 @item :tab-order
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
737 Specify the order in which widgets are traversed with
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
738 @code{widget-forward} or @code{widget-backward}. This is only partially
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
739 implemented.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
740
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
741 @enumerate a
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
742 @item
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
743 Widgets with tabbing order @code{-1} are ignored.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
744
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
745 @item
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
746 (Unimplemented) When on a widget with tabbing order @var{n}, go to the
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
747 next widget in the buffer with tabbing order @var{n+1} or @code{nil},
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
748 whichever comes first.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
749
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
750 @item
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
751 When on a widget with no tabbing order specified, go to the next widget
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
752 in the buffer with a positive tabbing order, or @code{nil}
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
753 @end enumerate
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
754
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
755 @item :parent
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
756 The parent of a nested widget (e.g. a @code{menu-choice} item or an
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
757 element of a @code{editable-list} widget).
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
758
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
759 @item :sibling-args
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
760 This keyword is only used for members of a @code{radio-button-choice} or
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
761 @code{checklist}. The value should be a list of extra keyword
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
762 arguments, which will be used when creating the @code{radio-button} or
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
763 @code{checkbox} associated with this item.
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
764 @end ignore
00022857f529 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
765 @end table