comparison man/custom.texi @ 153:25f70ba0133c r20-3b3

Import from CVS: tag r20-3b3
author cvs
date Mon, 13 Aug 2007 09:38:25 +0200
parents 538048ae2ab8
children 43dd3413c7c7
comparison
equal deleted inserted replaced
152:4c132ee2d62b 153:25f70ba0133c
11 11
12 @node Top, Introduction, (dir), (dir) 12 @node Top, Introduction, (dir), (dir)
13 @comment node-name, next, previous, up 13 @comment node-name, next, previous, up
14 @top The Customization Library 14 @top The Customization Library
15 15
16 Version: 1.97 16 Version: 1.98
17 17
18 @menu 18 @menu
19 * Introduction:: 19 * Introduction::
20 * User Commands:: 20 * User Commands::
21 * The Customization Buffer:: 21 * The Customization Buffer::
32 This library allows customization of @dfn{user options}. Currently two 32 This library allows customization of @dfn{user options}. Currently two
33 types of user options are supported, namely @dfn{variables} and 33 types of user options are supported, namely @dfn{variables} and
34 @dfn{faces}. Each user option can have four different values 34 @dfn{faces}. Each user option can have four different values
35 simultaneously: 35 simultaneously:
36 @table @dfn 36 @table @dfn
37 @item factory setting 37 @item standard setting
38 The value specified by the programmer. 38 The value specified by the programmer.
39 @item saved value 39 @item saved value
40 The value saved by the user as the default for this variable. This 40 The value saved by the user as the default for this variable. This
41 overwrites the factory setting when starting a new emacs. 41 overwrites the standard setting when starting a new emacs.
42 @item current value 42 @item current value
43 The value used by Emacs. This will not be remembered next time you 43 The value used by Emacs. This will not be remembered next time you
44 run Emacs. 44 run Emacs.
45 @item widget value 45 @item widget value
46 The value entered by the user in a customization buffer, but not yet 46 The value entered by the user in a customization buffer, but not yet
62 62
63 The following commands will create a customization buffer: 63 The following commands will create a customization buffer:
64 64
65 @table @code 65 @table @code
66 @item customize 66 @item customize
67 Create a customization buffer containing a specific group, by default 67 Create a customization buffer containing the @code{emacs} group.
68 the @code{emacs} group. 68
69 @item customize-group
70 Create a customization buffer containing a specific group.
69 71
70 @item customize-variable 72 @item customize-variable
71 Create a customization buffer containing a single variable. 73 Create a customization buffer containing a single variable.
72 74
73 @item customize-face 75 @item customize-face
151 customization options, and a line of customization buttons. Each part 153 customization options, and a line of customization buttons. Each part
152 will be described in the following. 154 will be described in the following.
153 155
154 @menu 156 @menu
155 * The Introductory Text:: 157 * The Introductory Text::
158 * The Customization Buttons::
156 * The Customization Options:: 159 * The Customization Options::
157 * The Variable Options:: 160 * The Variable Options::
158 * The Face Options:: 161 * The Face Options::
159 * The Group Options:: 162 * The Group Options::
160 * The State Button:: 163 * The State Button::
161 * The Customization Buttons::
162 @end menu 164 @end menu
163 165
164 @node The Introductory Text, The Customization Options, The Customization Buffer, The Customization Buffer 166 @node The Introductory Text, The Customization Buttons, The Customization Buffer, The Customization Buffer
165 @comment node-name, next, previous, up 167 @comment node-name, next, previous, up
166 @subsection The Introductory Text 168 @subsection The Introductory Text
167 169
168 The start of the buffer contains a short explanation of what it is, and 170 The start of the buffer contains a short explanation of what it is, and
169 how to get help. It will typically look like this: 171 how to get help. It will typically look like this:
175 177
176 Rather boring. It is mostly just informative text, but the word 178 Rather boring. It is mostly just informative text, but the word
177 @samp{help} is a button that will bring up this document when 179 @samp{help} is a button that will bring up this document when
178 activated. 180 activated.
179 181
180 @node The Customization Options, The Variable Options, The Introductory Text, The Customization Buffer 182 @node The Customization Buttons, The Customization Options, The Introductory Text, The Customization Buffer
183 @comment node-name, next, previous, up
184 @subsection The Customization Buttons
185
186 The next part of the customization buffer looks like this:
187
188 @example
189 [Set] [Save] [Reset] [Done]
190 @end example
191
192 Activating the @samp{[Set]}, @samp{[Save]}, or @samp{[Reset]}
193 button will affect all modified customization items that are visible in
194 the buffer. @samp{[Done]} will bury the buffer.
195
196 @node The Customization Options, The Variable Options, The Customization Buttons, The Customization Buffer
181 @comment node-name, next, previous, up 197 @comment node-name, next, previous, up
182 @subsection The Customization Options 198 @subsection The Customization Options
183 199
184 Each customization option looks similar to the following text: 200 Each customization option looks similar to the following text:
185 201
186 @example 202 @example
187 *** custom-background-mode: default 203 Custom Background Mode: default
188 State: this item is unchanged from its factory setting. 204 State: this item is unchanged from its standard setting.
189 [ ] [?] The brightness of the background. 205 [?] The brightness of the background.
190 @end example 206 @end example
191 207
192 The option contains the parts described below. 208 The option contains the parts described below.
193 209
194 @table @samp 210 @table @samp
195 @item *** 211 @item Custom Background Mode
196 The Level Button. The customization options in the buffer are organized
197 in a hierarchy, which is indicated by the number of stars in the level
198 button. The top level options will be shown as @samp{*}. When they are
199 expanded, the suboptions will be shown as @samp{**}. The example option
200 is thus a subsuboption.
201
202 Activating the level buttons will toggle between hiding and exposing the
203 content of that option. The content can either be the value of the
204 option, as in this example, or a list of suboptions.
205
206 @item custom-background-mode
207 This is the tag of the the option. The tag is a name of a variable, a 212 This is the tag of the the option. The tag is a name of a variable, a
208 face, or customization group. Activating the tag has an effect that 213 face, or customization group. Activating the tag has an effect that
209 depends on the exact type of the option. In this particular case, 214 depends on the exact type of the option. In this particular case,
210 activating the tag will bring up a menu that will allow you to choose 215 activating the tag will bring up a menu that will allow you to choose
211 from the three possible values of the `custom-background-mode' 216 from the three possible values of the `custom-background-mode'
215 After the tag, the options value is shown. Depending on its type, you 220 After the tag, the options value is shown. Depending on its type, you
216 may be able to edit the value directly. If an option should contain a 221 may be able to edit the value directly. If an option should contain a
217 file name, it is displayed in an editable field, i.e. you can edit it 222 file name, it is displayed in an editable field, i.e. you can edit it
218 using the standard emacs editing commands. 223 using the standard emacs editing commands.
219 224
220 @item State: this item is unchanged from its factory setting. 225 @item State: this item is unchanged from its standard setting.
221 The state line. This line will explain the state of the option, 226 The state line. This line will explain the state of the option,
222 e.g. whether it is currently hidden, or whether it has been modified or 227 e.g. whether it is currently hidden, or whether it has been modified or
223 not. Activating the button will allow you to change the state, e.g. set 228 not. Activating the button will allow you to change the state, e.g. set
224 or reset the changes you have made. This is explained in detail in the 229 or reset the changes you have made. This is explained in detail in the
225 following sections. 230 following sections.
226
227 @item [ ]
228 The magic button. This is an abbreviated version of the state line.
229 231
230 @item [?] 232 @item [?]
231 The documentation button. If the documentation is more than one line, 233 The documentation button. If the documentation is more than one line,
232 this button will be present. Activating the button will toggle whether 234 this button will be present. Activating the button will toggle whether
233 the complete documentation is shown, or only the first line. 235 the complete documentation is shown, or only the first line.
256 You can either choose to edit the value directly, or edit the lisp 258 You can either choose to edit the value directly, or edit the lisp
257 value for that variable. The lisp value is a lisp expression that 259 value for that variable. The lisp value is a lisp expression that
258 will be evaluated when you start emacs. The result of the evaluation 260 will be evaluated when you start emacs. The result of the evaluation
259 will be used as the initial value for that variable. Editing the 261 will be used as the initial value for that variable. Editing the
260 lisp value is for experts only, but if the current value of the 262 lisp value is for experts only, but if the current value of the
261 variable is of a wrong type (i.e. a symbol where a string is expected), 263 variable is of a wrong type (e.g. a symbol where a string is expected),
262 the `edit lisp' mode will always be selected. 264 the `edit lisp' mode will always be selected.
263 265
264 You can see what mode is currently selected by looking at the state 266 You can see what mode is currently selected by looking at the state
265 button. If it uses parenthesises (like @samp{( )}) it is in edit lisp 267 description. It will end with @samp{(lisp)} in lisp mode.
266 mode, with square brackets (like @samp{[ ]}) it is normal edit mode. 268
267 You can switch mode by activating the state button, and select either 269 You can switch mode by activating the state button, and select either
268 @samp{Edit} or @samp{Edit lisp} from the menu. 270 @samp{Edit} or @samp{Edit lisp} from the menu.
269 271
270 You can change the state of the variable with the other menu items: 272 You can change the state of the variable with the other menu items:
271 273
286 288
287 @item Reset to Saved 289 @item Reset to Saved
288 Activating this item will reset the value of the variable to the last 290 Activating this item will reset the value of the variable to the last
289 value you marked as permanent with `Save'. 291 value you marked as permanent with `Save'.
290 292
291 @item Reset to Factory Settings 293 @item Reset to Standard Settings
292 Activating this item will undo all modifications you have made, and 294 Activating this item will undo all modifications you have made, and
293 reset the value to the initial value specified by the program itself. 295 reset the value to the initial value specified by the program itself.
294 @end table 296 @end table
295 297
296 By default, the value of large or complicated variables are hidden. You 298 By default, the value of large or complicated variables are hidden.
297 can show the value by clicking on the level button. 299 You can change this with the @samp{Hide} and @samp{Show} entries in the
300 state menu.
298 301
299 @node The Face Options, The Group Options, The Variable Options, The Customization Buffer 302 @node The Face Options, The Group Options, The Variable Options, The Customization Buffer
300 @comment node-name, next, previous, up 303 @comment node-name, next, previous, up
301 @subsection The Face Options 304 @subsection The Face Options
302 305
318 face attributes. For each face attribute, there is a checkbox 321 face attributes. For each face attribute, there is a checkbox
319 specifying whether this attribute has effect and what the value is. 322 specifying whether this attribute has effect and what the value is.
320 Here is an example: 323 Here is an example:
321 324
322 @example 325 @example
323 *** custom-invalid-face: (sample) 326 Custom Invalid Face: (sample)
324 State: this item is unchanged from its factory setting. 327 State: this item is unchanged from its standard setting.
325 [ ] Face used when the customize item is invalid. 328 Face used when the customize item is invalid.
326 [INS] [DEL] Display: [ ] Type: [ ] X [ ] PM [ ] Win32 [ ] DOS [ ] TTY 329 [INS] [DEL] Display: [ ] Type: [ ] X [ ] PM [ ] Win32 [ ] DOS [ ] TTY
327 [X] Class: [X] Color [ ] Grayscale [ ] Monochrome 330 [X] Class: [X] Color [ ] Grayscale [ ] Monochrome
328 [ ] Background: [ ] Light [ ] Dark 331 [ ] Background: [ ] Light [ ] Dark
329 Attributes: [ ] Bold: off 332 Attributes: [ ] Bold: off
330 [ ] Italic: off 333 [ ] Italic: off
343 @end example 346 @end example
344 347
345 This has two display specifications. The first will match all color 348 This has two display specifications. The first will match all color
346 displays, independently on what window system the device belongs to, and 349 displays, independently on what window system the device belongs to, and
347 whether background color is dark or light. For devices matching this 350 whether background color is dark or light. For devices matching this
348 specification, @samp{custom-invalid-face} will force text to be 351 specification, @samp{Custom Invalid Face} will force text to be
349 displayed in yellow on red, but leave all other attributes alone. 352 displayed in yellow on red, but leave all other attributes alone.
350 353
351 The second display will simply match everything. Since the list is 354 The second display will simply match everything. Since the list is
352 prioritised, this means that it will match all non-color displays. For 355 prioritised, this means that it will match all non-color displays. For
353 these, the face will not affect the foreground or background color, but 356 these, the face will not affect the foreground or background color, but
362 365
363 After modifying the face, you can activate the state button to make the 366 After modifying the face, you can activate the state button to make the
364 changes take effect. The menu items in the state button menu is similar 367 changes take effect. The menu items in the state button menu is similar
365 to the state menu items for variables described in the previous section. 368 to the state menu items for variables described in the previous section.
366 369
370 Faces usually start out hidden, activate the @samp{State} button to show
371 them.
372
367 @node The Group Options, The State Button, The Face Options, The Customization Buffer 373 @node The Group Options, The State Button, The Face Options, The Customization Buffer
368 @comment node-name, next, previous, up 374 @comment node-name, next, previous, up
369 @subsection The Group Options 375 @subsection The Group Options
370 376
371 Since Emacs has approximately a zillion configuration options, they have 377 Since Emacs has approximately a zillion configuration options, they have
372 been organized in groups. Each group can contain other groups, thus 378 been organized in groups. Each group can contain other groups, thus
373 creating a customization hierarchy. The nesting of the customization 379 creating a customization hierarchy. The nesting of the customization
374 within the visible part of this hierarchy is indicated by the number of 380 within the visible part of this hierarchy is indicated by the number of
375 stars in the level button. 381 asterisks before the name of the group.
376 382
377 Since there is really no customization needed for the group itself, the 383 Since there is really no customization needed for the group itself, the
378 menu items in the groups state button will affect all modified group 384 menu items in the groups state button will affect all modified group
379 members recursively. Thus, if you activate the @samp{Set} menu item, 385 members recursively. Thus, if you activate the @samp{Set} menu item,
380 all variables and faces that have been modified and belong to that group 386 all variables and faces that have been modified and belong to that group
381 will be applied. For those members that themselves are groups, it will 387 will be applied. For those members that themselves are groups, it will
382 work as if you had activated the @samp{Set} menu item on them as well. 388 work as if you had activated the @samp{Set} menu item on them as well.
383 389
384 @node The State Button, The Customization Buttons, The Group Options, The Customization Buffer 390 @node The State Button, , The Group Options, The Customization Buffer
385 @comment node-name, next, previous, up 391 @comment node-name, next, previous, up
386 @subsection The State Line and The Magic Button 392 @subsection The State Line and The Magic Button
387 393
388 The state line has two purposes. The first is to hold the state menu, 394 The state line has two purposes. The first is to hold the state menu,
389 as described in the previous sections. The second is to indicate the 395 as described in the previous sections. The second is to indicate the
390 state of each customization item. 396 state of each customization item.
391 397
392 For the magic button, this is done by the character inside the brackets. 398 There is an optional `magic button' that holds the same information in a
399 more compact form. The magic button contain a character inside the
400 brackets (in edit mode) or parentheses (in lisp mode).
401
402 @defopt custom-magic-show-button
403 Show a magic button indicating the state of each customization option.
404 @end defopt
405
393 The following states have been defined, the first that applies to the 406 The following states have been defined, the first that applies to the
394 current item will be used: 407 current item will be used:
395 408
396 @table @samp 409 @table @samp
397 @item - 410 @item -
409 422
410 @item : 423 @item :
411 The current value of this option is different from the saved value. 424 The current value of this option is different from the saved value.
412 425
413 @item ! 426 @item !
414 The saved value of this option is different from the factory setting. 427 The saved value of this option is different from the standard setting.
415 428
416 @item @@ 429 @item @@
417 The factory setting of this option is not known. This occurs when you 430 The standard setting of this option is not known. This occurs when you
418 try to customize variables or faces that have not been explicitly 431 try to customize variables or faces that have not been explicitly
419 declared as customizable. 432 declared as customizable.
420 433
421 @item SPC 434 @item SPC
422 The factory setting is still in effect. 435 The standard setting is still in effect.
423 436
424 @end table 437 @end table
425 438
426 For non-hidden group options, the state shown is the most severe state 439 For non-hidden group options, the state shown is the most severe state
427 of its members, where more severe means that it appears earlier in the 440 of its members, where more severe means that it appears earlier in the
428 list above (except hidden members, which are ignored). 441 list above (except hidden members, which are ignored).
429
430 @node The Customization Buttons, , The State Button, The Customization Buffer
431 @comment node-name, next, previous, up
432 @subsection The Customization Buttons
433
434 The last part of the customization buffer looks like this:
435
436 @example
437 [Set] [Save] [Reset] [Done]
438 @end example
439
440 Activating the @samp{[Set]}, @samp{[Save]}, or @samp{[Reset]}
441 button will affect all modified customization items that are visible in
442 the buffer. @samp{[Done]} will bury the buffer.
443 442
444 @node Declarations, Utilities, The Customization Buffer, Top 443 @node Declarations, Utilities, The Customization Buffer, Top
445 @comment node-name, next, previous, up 444 @comment node-name, next, previous, up
446 @section Declarations 445 @section Declarations
447 446
579 @xref{Sexp Types,,,widget,The Widget Library}, for information about 578 @xref{Sexp Types,,,widget,The Widget Library}, for information about
580 widgets to use together with the @code{:type} keyword. 579 widgets to use together with the @code{:type} keyword.
581 @end defun 580 @end defun
582 581
583 Internally, custom uses the symbol property @code{custom-type} to keep 582 Internally, custom uses the symbol property @code{custom-type} to keep
584 track of the variables type, @code{factory-value} for the program 583 track of the variables type, @code{standard-value} for the program
585 specified default value, @code{saved-value} for a value saved by the 584 specified default value, @code{saved-value} for a value saved by the
586 user, and @code{variable-documentation} for the documentation string. 585 user, and @code{variable-documentation} for the documentation string.
587 586
588 Use @code{custom-add-option} to specify that a specific function is 587 Use @code{custom-add-option} to specify that a specific function is
589 useful as an meber of a hook. 588 useful as an meber of a hook.
614 613
615 @var{spec} should be an alist of the form @samp{((@var{display} @var{atts})...)}. 614 @var{spec} should be an alist of the form @samp{((@var{display} @var{atts})...)}.
616 615
617 @var{atts} is a list of face attributes and their values. The possible 616 @var{atts} is a list of face attributes and their values. The possible
618 attributes are defined in the variable `custom-face-attributes'. 617 attributes are defined in the variable `custom-face-attributes'.
619 Alternatively, @var{atts} can be a face in which case the attributes of
620 that face is used.
621 618
622 The @var{atts} of the first entry in @var{spec} where the @var{display} 619 The @var{atts} of the first entry in @var{spec} where the @var{display}
623 matches the frame should take effect in that frame. @var{display} can 620 matches the frame should take effect in that frame. @var{display} can
624 either be the symbol `t', which will match all frames, or an alist of 621 either be the symbol `t', which will match all frames, or an alist of
625 the form @samp{((@var{req} @var{item}...)...)}@refill 622 the form @samp{((@var{req} @var{item}...)...)}@refill
790 @code{custom-save-customized} is called. 787 @code{custom-save-customized} is called.
791 788
792 @item 789 @item
793 Better handling of saved but uninitialized items. 790 Better handling of saved but uninitialized items.
794 791
792 @item
793 Detect when faces have been changed outside customize.
794
795 @item
796 Activate mouse help in Emacs by default.
797
798 @item
799 Group members should be sorted, groups last.
800
801 @item
802 Add an easy way to display the standard settings when an item is modified.
803
795 @end itemize 804 @end itemize
796 805
797 @contents 806 @contents
798 @bye 807 @bye