4 @setfilename custom.info
5 @settitle The Customization Library
12 @node Top, Introduction, (dir), (dir)
13 @comment node-name, next, previous, up
14 @top The Customization Library
21 * The Customization Buffer::
23 * Declaring Variables::
29 @node Introduction, User Commands, Top, Top
30 @comment node-name, next, previous, up
33 This library allows customization of @dfn{user options}. Currently two
34 types of user options are supported, namely @dfn{variables} and
35 @dfn{faces}. Each user option can have four different values
39 The value specified by the programmer.
41 The value specified by the user as the default for this variable. This
42 overwrites the factory setting when starting a new emacs.
44 The value used by Emacs. This will not be remembered next time you
47 The value entered by the user in a customization buffer, but not yet
51 Variables also have a @dfn{type}, which specifies what kind of values
52 the variable can hold, and how the value is presented in a customization
53 buffer. By default a variable can hold any valid expression, but the
54 programmer can specify a more limited type when declaring the variable.
56 The user options are organized in a number of @dfn{groups}. Each group
57 can contain a number user options, as well as other groups. The groups
58 allows the user to concentrate on a specific part of emacs.
60 @node User Commands, The Customization Buffer, Introduction, Top
61 @comment node-name, next, previous, up
62 @section User Commands
64 The following commands will create a customization buffer:
68 Create a customization buffer containing a specific group, by default
69 the @code{emacs} group.
71 @item customize-variable
72 Create a customization buffer containing a single variable.
75 Create a customization buffer contaning a single face.
77 @item customize-apropos
78 Create a customization buffer containing all variables, faces, and
79 groups that match a user specified regular expression.
82 @node The Customization Buffer, Declaring Groups, User Commands, Top
83 @comment node-name, next, previous, up
84 @section The Customization Buffer.
86 Here should be a description of how to use a customization buffer.
87 For now, try to press @kbd{C-h m} in the buffer, or read @ref{User
88 Interface,,widget,The Widget Library}.
90 The interface will change, as it currently stinks. Here is some hints
91 about how to use it though:
95 Groups and user option start on a new line, and look like this
96 @t{@b{name}:}. If you move point above to the @t{@b{name}} and press
97 @kbd{@key{RET}}, or move the mouse pointer above it and press
98 @kbd{mouse-2}, you will be presented with a menu. I call this the
102 For groups and faces, you need to activate @samp{Toggle Hide} from the
103 tag menu to be able to see the content.
106 After editing a variable or face, you must activate @samp{Apply} for the
107 setting to take effect, and @samp{Set Default} for marking the widget
108 value as the new default value.
111 After setting new default values with @samp{Set Default}, you must
112 activate the @samp{Save} button in the bottom of the screen to save the
113 new defaults. Otherwise the new defaults will be silently forgotten.
116 Pushing @samp{Save} is a no-op unless you have activated @samp{Set Default}
117 for some user option.
120 The @code{face} widget never attempts to display the current value of a
121 face. Instead it allows you to specify how the face should be
122 initialized. This is done with a list of @dfn{display} and
123 @dfn{attributes} pairs, where the first display that matches a frame
124 specify the attributes to use for that frame.
126 A display can either match all frames, or only frames with a given
127 @dfn{type}, @dfn{class}, and @dfn{background}. The checkbox before each
128 of these display parameters determine whether the parameter will be
129 checked. If the checkbox before @samp{Type} is unchecked, the display
130 will match all types of frames. If it is checked, it will match the
131 type of frames specified on the rest of the line.
133 The attributes are specified next. Each attribute line begins with a
134 checkbox, if that checkbox is unchecked the face will not affect that
135 particular attribute on the screen, otherwise the face will force the
136 the text to have the value for attribute specified after the attrbute
137 name. This means that an attribute like @samp{bold} in effect have
138 three states: If the first checkmark is unchecked, the face will not
139 affect the boldness of the text. If the first checkmark is checked, but
140 the second is unchecked, the text will be forced to be unbold. If both
141 checkmarks are checked, the text will be forced to be bold.
143 Think about this, and mail me a suggestion for how to make the face
144 widget more intuitive.
147 @node Declaring Groups, Declaring Variables, The Customization Buffer, Top
148 @comment node-name, next, previous, up
149 @section Declaring Groups
151 Use @code{defgroup} to declare new customization groups.
153 @defun defgroup symbol members [keyword value]... doc
154 Declare @var{symbol} as a customization group containing @var{members}.
155 @var{symbol} does not need to be quoted.
157 @var{members} should be an alist of the form ((@var{name}
158 @var{widget})...) where @var{name} is a symbol and @var{widget} is a
159 widget for editing that symbol. Useful widgets are
160 @code{custom-variable} for editing variables, @code{custom-face} for
161 editing faces, and @code{custom-group} for editing groups.@refill
163 @var{doc} is the group documentation.
165 The following @var{keyword}'s are defined:
169 @var{value} should be a customization group.
170 Add @var{symbol} to that group.
174 Internally, custom uses the symbol property @code{custom-group} to keep
175 track of the group members, and @code{group-documentation} for the
176 documentation string.
178 @node Declaring Variables, Declaring Faces, Declaring Groups, Top
179 @comment node-name, next, previous, up
180 @section Declaring Variables
182 Use @code{defcustom} to declare user editable variables.
184 @defun defcustom symbol [keyword value]... doc
185 Declare @var{symbol} as a customizable variable that defaults to @var{value}.
186 Neither @var{symbol} nor @var{value} needs to be quoted.
187 If @var{symbol} is not already bound, initialize it to @var{value}.
189 @var{doc} is the variable documentation.
191 The following @var{keyword}'s are defined:
195 @var{value} should be a sexp widget.
197 @var{value} should be a customization group.
198 Add @var{symbol} to that group.
201 @xref{Sexp Types,,widget,The Widget Library}, for information about
202 widgets to use together with the @code{:type} keyword.
205 Internally, custom uses the symbol property @code{custom-type} to keep
206 track of the variables type, @code{factory-value} for the program
207 specified default value, @code{default-value} for a user specified
208 default value, and @code{variable-documentation} for the documentation
212 @node Declaring Faces, The Init File, Declaring Variables, Top
213 @comment node-name, next, previous, up
214 @section Declaring Faces
216 Faces are declared with @code{defface}.
218 @defun defface FACE SPEC [KEYWORD VALUE]... DOC
220 Declare @var{face} as a customizable face that defaults to @var{spec}.
221 @var{face} does not need to be quoted.
223 If @var{face} has been set with `custom-set-face', set the face attributes
224 as specified by that function, otherwise set the face attributes
225 according to @var{spec}.
227 @var{doc} is the face documentation.
229 The following @var{keyword}'s are defined:
233 @var{value} should be a customization group.
234 Add @var{symbol} to that group.
237 @var{spec} should be an alist of the form @samp{((@var{display} @var{atts})...)}.
239 @var{atts} is a list of face attributes and their values. The possible
240 attributes are defined in the variable `custom-face-attributes'.
241 Alternatively, @var{atts} can be a face in which case the attributes of
244 The @var{atts} of the first entry in @var{spec} where the @var{display}
245 matches the frame should take effect in that frame. @var{display} can
246 either be the symbol `t', which will match all frames, or an alist of
247 the form @samp{((@var{req} @var{item}...)...)}@refill
249 For the @var{display} to match a FRAME, the @var{req} property of the
250 frame must match one of the @var{item}. The following @var{req} are
255 (the value of (window-system))@br
256 Should be one of @code{x} or @code{tty}.
259 (the frame's color support)@br
260 Should be one of @code{color}, @code{grayscale}, or @code{mono}.
263 (what color is used for the background text)@br
264 Should be one of @code{light} or @code{dark}.
267 Internally, custom uses the symbol property @code{factory-face} for the
268 program specified default face properties, @code{default-face} for a
269 user specified default properties, and @code{face-documentation} for the
270 documentation string.@refill
274 @node The Init File, Wishlist, Declaring Faces, Top
275 @comment node-name, next, previous, up
276 @section The Init File
278 When you save the customizations, call to @code{custom-set-variables},
279 @code{custom-set-faces} are inserted into the file specified by
280 @code{custom-file}. By default @code{custom-file} is your @file{.emacs}
281 file. The two functions will initialize variables and faces as you have
284 @node Wishlist, , The Init File, Top
285 @comment node-name, next, previous, up
290 The names of the menu items for the @code{custom-variable},
291 @code{custom-face}, and @code{custom-group} tags should be rethought.
292 Some of the actions may be better placed as buttons in the buffer.
295 The menu items above should be grayed out when the information is
296 missing. I.e. if a variable doesn't have a factory setting, the user
297 should not be allowed to select the @samp{Factory} menu item.
300 We need @strong{much} better support for keyboard operations in the
304 There should be buttons that will apply, set, reset, etc. all the relevant
305 widgets in a customize buffer.
308 There should be a menu in the customize buffer.
311 The group widget should allow you to apply, set, reset, etc. all the
312 relevant members of the group.
315 There should be a function to create a customize menu from a group.
318 There should be a `Help | Customize' entry in the menu bar with a user
319 specified number of levels of submenus.
322 It would be nice if one could set simple variables directly from the
326 Support real specifiers under XEmacs.
329 @code{customize-apropos} should only match user options that has either
330 been declared with this library, or variables whose documentation start
331 with @samp{*}. With an prefix argument, also match all variables that
332 has a documentation string.
335 If there is only one line of documentation, the @samp{Documentation}
336 tag-menu items should go from `first line only' to `none' without going
337 over `full'. I.e. it should have two states instead of three.
340 @code{custom-face} should display the @code{face-documentation}
344 @code{custom-face}, @code{custom-variable}, and @code{custom-group}
345 should be derived from a common @code{custom} widget.
348 Integrate with @file{w3} so you can customization buffers with much
349 better formatting. I'm thinking about adding a <custom>name</custom>