comparison man/xemacs/custom.texi @ 195:a2f645c6b9f8 r20-3b24

Import from CVS: tag r20-3b24
author cvs
date Mon, 13 Aug 2007 09:59:05 +0200
parents 360340f9fd5f
children e45d5e7c476e
comparison
equal deleted inserted replaced
194:2947057885e5 195:a2f645c6b9f8
106 specifies the position of the right margin (as a number of characters from 106 specifies the position of the right margin (as a number of characters from
107 the left margin) to be used by the fill commands (@pxref{Filling}). 107 the left margin) to be used by the fill commands (@pxref{Filling}).
108 108
109 @menu 109 @menu
110 * Examining:: Examining or setting one variable's value. 110 * Examining:: Examining or setting one variable's value.
111 * Easy Customization:: Convenient and easy customization of variables.
111 * Edit Options:: Examining or editing list of all variables' values. 112 * Edit Options:: Examining or editing list of all variables' values.
112 * Locals:: Per-buffer values of variables. 113 * Locals:: Per-buffer values of variables.
113 * File Variables:: How files can specify variable values. 114 * File Variables:: How files can specify variable values.
114 @end menu 115 @end menu
115 116
168 sets @code{fill-column} to 75, as if you had executed the Lisp expression 169 sets @code{fill-column} to 75, as if you had executed the Lisp expression
169 @code{(setq fill-column 75)}. 170 @code{(setq fill-column 75)}.
170 171
171 Setting variables in this way, like all means of customizing Emacs 172 Setting variables in this way, like all means of customizing Emacs
172 except where explicitly stated, affects only the current Emacs session. 173 except where explicitly stated, affects only the current Emacs session.
174
175 @node Easy Customization
176 @subsection Easy Customization Interface
177
178 @findex customize
179 @cindex customization buffer
180 A convenient way to find the user option variables that you want to
181 change, and then change them, is with @kbd{M-x customize}. This command
182 creates a @dfn{customization buffer} with which you can browse through
183 the Emacs user options in a logically organized structure, then edit and
184 set their values. You can also use the customization buffer to save
185 settings permanently. (Not all Emacs user options are included in this
186 structure as of yet, but we are adding the rest.)
187
188 @menu
189 * Groups: Customization Groups.
190 How options are classified in a structure.
191 * Changing an Option:: How to edit a value and set an option.
192 * Face Customization:: How to edit the attributes of a face.
193 * Specific Customization:: Making a customization buffer for specific
194 options, faces, or groups.
195 @end menu
196
197 @node Customization Groups
198 @subsubsection Customization Groups
199 @cindex customization groups
200
201 For customization purposes, user options are organized into
202 @dfn{groups} to help you find them. Groups are collected into bigger
203 groups, all the way up to a master group called @code{Emacs}.
204
205 @kbd{M-x customize} creates a customization buffer that shows the
206 top-level @code{Emacs} group and the second-level groups immediately
207 under it. It looks like this, in part:
208
209 @smallexample
210 /- Emacs group: ---------------------------------------------------\
211 [State]: visible group members are all at standard settings.
212 Customization of the One True Editor.
213 See also [Manual].
214
215 Editing group: [Go to Group]
216 Basic text editing facilities.
217
218 External group: [Go to Group]
219 Interfacing to external utilities.
220
221 @var{more second-level groups}
222
223 \- Emacs group end ------------------------------------------------/
224
225 @end smallexample
226
227 @noindent
228 This says that the buffer displays the contents of the @code{Emacs}
229 group. The other groups are listed because they are its contents. But
230 they are listed differently, without indentation and dashes, because
231 @emph{their} contents are not included. Each group has a single-line
232 documentation string; the @code{Emacs} group also has a @samp{[State]}
233 line.
234
235 @cindex editable fields (customization buffer)
236 @cindex active fields (customization buffer)
237 Most of the text in the customization buffer is read-only, but it
238 typically includes some @dfn{editable fields} that you can edit. There
239 are also @dfn{active fields}; this means a field that does something
240 when you @dfn{invoke} it. To invoke an active field, either click on it
241 with @kbd{Mouse-1}, or move point to it and type @key{RET}.
242
243 For example, the phrase @samp{[Go to Group]} that appears in a
244 second-level group is an active field. Invoking the @samp{[Go to
245 Group]} field for a group creates a new customization buffer, which
246 shows that group and its contents. This field is a kind of hypertext
247 link to another group.
248
249 The @code{Emacs} group does not include any user options itself, but
250 other groups do. By examining various groups, you will eventually find
251 the options and faces that belong to the feature you are interested in
252 customizing. Then you can use the customization buffer to set them.
253
254 @findex customize-browse
255 You can view the structure of customization groups on a larger scale
256 with @kbd{M-x customize-browse}. This command creates a special kind of
257 customization buffer which shows only the names of the groups (and
258 options and faces), and their structure.
259
260 In this buffer, you can show the contents of a group by invoking
261 @samp{[+]}. When the group contents are visible, this button changes to
262 @samp{[-]}; invoking that hides the group contents.
263
264 Each group, option or face name in this buffer has an active field
265 which says @samp{[Group]}, @samp{[Option]} or @samp{[Face]}. Invoking
266 that active field creates an ordinary customization buffer showing just
267 that group and its contents, just that option, or just that face.
268 This is the way to set values in it.
269
270 @node Changing an Option
271 @subsubsection Changing an Option
272
273 Here is an example of what a user option looks like in the
274 customization buffer:
275
276 @smallexample
277 Kill Ring Max: [Hide] 30
278 [State]: this option is unchanged from its standard setting.
279 Maximum length of kill ring before oldest elements are thrown away.
280 @end smallexample
281
282 The text following @samp{[Hide]}, @samp{30} in this case, indicates
283 the current value of the option. If you see @samp{[Show]} instead of
284 @samp{[Hide]}, it means that the value is hidden; the customization
285 buffer initially hides values that take up several lines. Invoke
286 @samp{[Show]} to show the value.
287
288 The line after the option name indicates the @dfn{customization state}
289 of the option: in the example above, it says you have not changed the
290 option yet. The word @samp{[State]} at the beginning of this line is
291 active; you can get a menu of various operations by invoking it with
292 @kbd{Mouse-1} or @key{RET}. These operations are essential for
293 customizing the variable.
294
295 The line after the @samp{[State]} line displays the beginning of the
296 option's documentation string. If there are more lines of
297 documentation, this line ends with @samp{[More]}; invoke this to show
298 the full documentation string.
299
300 To enter a new value for @samp{Kill Ring Max}, move point to the value
301 and edit it textually. For example, you can type @kbd{M-d}, then insert
302 another number.
303
304 When you begin to alter the text, you will see the @samp{[State]} line
305 change to say that you have edited the value:
306
307 @smallexample
308 [State]: you have edited the value as text, but not set the option.
309 @end smallexample
310
311 @cindex setting option value
312 Editing the value does not actually set the option variable. To do
313 that, you must @dfn{set} the option. To do this, invoke the word
314 @samp{[State]} and choose @samp{Set for Current Session}.
315
316 The state of the option changes visibly when you set it:
317
318 @smallexample
319 [State]: you have set this option, but not saved it for future sessions.
320 @end smallexample
321
322 You don't have to worry about specifying a value that is not valid;
323 setting the option checks for validity and will not really install an
324 unacceptable value.
325
326 @kindex M-TAB @r{(customization buffer)}
327 @findex widget-complete
328 While editing a value or field that is a file name, directory name,
329 command name, or anything else for which completion is defined, you can
330 type @kbd{M-@key{TAB}} (@code{widget-complete}) to do completion.
331
332 Some options have a small fixed set of possible legitimate values.
333 These options don't let you edit the value textually. Instead, an
334 active field @samp{[Value Menu]} appears before the value; invoke this
335 field to edit the value. For a boolean ``on or off'' value, the active
336 field says @samp{[Toggle]}, and it changes to the other value.
337 @samp{[Value Menu]} and @samp{[Toggle]} edit the buffer; the changes
338 take effect when you use the @samp{Set for Current Session} operation.
339
340 Some options have values with complex structure. For example, the
341 value of @code{load-path} is a list of directories. Here is how it
342 appears in the customization buffer:
343
344 @smallexample
345 Load Path:
346 [INS] [DEL] [Current dir?]: /usr/local/share/emacs/19.34.94/site-lisp
347 [INS] [DEL] [Current dir?]: /usr/local/share/emacs/site-lisp
348 [INS] [DEL] [Current dir?]: /usr/local/share/emacs/19.34.94/leim
349 [INS] [DEL] [Current dir?]: /usr/local/share/emacs/19.34.94/lisp
350 [INS] [DEL] [Current dir?]: /build/emacs/e19/lisp
351 [INS] [DEL] [Current dir?]: /build/emacs/e19/lisp/gnus
352 [INS]
353 [State]: this item has been changed outside the customization buffer.
354 List of directories to search for files to load....
355 @end smallexample
356
357 @noindent
358 Each directory in the list appears on a separate line, and each line has
359 several editable or active fields.
360
361 You can edit any of the directory names. To delete a directory from
362 the list, invoke @samp{[DEL]} on that line. To insert a new directory in
363 the list, invoke @samp{[INS]} at the point where you want to insert it.
364
365 You can also invoke @samp{[Current dir?]} to switch between including
366 a specific named directory in the path, and including @code{nil} in the
367 path. (@code{nil} in a search path means ``try the current
368 directory.'')
369
370 @kindex TAB @r{(customization buffer)}
371 @kindex S-TAB @r{(customization buffer)}
372 @findex widget-forward
373 @findex widget-backward
374 Two special commands, @key{TAB} and @kbd{S-@key{TAB}}, are useful for
375 moving through the customization buffer. @key{TAB}
376 (@code{widget-forward}) moves forward to the next active or editable
377 field; @kbd{S-@key{TAB}} (@code{widget-backward}) moves backward to the
378 previous active or editable field.
379
380 Typing @key{RET} on an editable field also moves forward, just like
381 @key{TAB}. The reason for this is that people have a tendency to type
382 @key{RET} when they are finished editing a field. If you have occasion
383 to insert a newline in an editable field, use @kbd{C-o} or @kbd{C-q
384 C-j},
385
386 @cindex saving option value
387 Setting the option changes its value in the current Emacs session;
388 @dfn{saving} the value changes it for future sessions as well. This
389 works by writing code into your @file{~/.emacs} file so as to set the
390 option variable again each time you start Emacs. To save the option,
391 invoke @samp{[State]} and select the @samp{Save for Future Sessions}
392 operation.
393
394 You can also restore the option to its standard value by invoking
395 @samp{[State]} and selecting the @samp{Reset to Standard Settings}
396 operation. There are actually three reset operations:
397
398 @table @samp
399 @item Reset
400 If you have made some modifications and not yet set the option,
401 this restores the text in the customization buffer to match
402 the actual value.
403
404 @item Reset to Saved
405 This restores the value of the option to the last saved value,
406 and updates the text accordingly.
407
408 @item Reset to Standard Settings
409 This sets the option to its standard value, and updates the text
410 accordingly. This also eliminates any saved value for the option,
411 so that you will get the standard value in future Emacs sessions.
412 @end table
413
414 The state of a group indicates whether anything in that group has been
415 edited, set or saved. You can select @samp{Set for Current Session},
416 @samp{Save for Future Sessions} and the various kinds of @samp{Reset}
417 operation for the group; these operations on the group apply to all
418 options in the group and its subgroups.
419
420 Near the top of the customization buffer there are two lines
421 containing several active fields:
422
423 @smallexample
424 [Set] [Save] [Reset] [Reset to Saved] [Reset to Standard] [Done]
425 @end smallexample
426
427 @noindent
428 Invoking @samp{[Done]} buries this customization buffer. Each of the
429 other fields performs an operation---set, save or reset---on each of the
430 items in the buffer that could meaningfully be set, saved or reset.
431
432 @node Face Customization
433 @subsubsection Customizing Faces
434 @cindex customizing faces
435 @cindex bold font
436 @cindex italic font
437 @cindex fonts and faces
438
439 In addition to user options, some customization groups also include
440 faces. When you show the contents of a group, both the user options and
441 the faces in the group appear in the customization buffer. Here is an
442 example of how a face looks:
443
444 @smallexample
445 Custom Changed Face: (sample)
446 [State]: this face is unchanged from its standard setting.
447 Face used when the customize item has been changed.
448 Attributes: [ ] Bold: [toggle] off
449 [X] Italic: [toggle] on
450 [ ] Underline: [toggle] off
451 [ ] Inverse-Video: [toggle] on
452 [ ] Foreground: black (sample)
453 [ ] Background: white (sample)
454 [ ] Stipple:
455 @end smallexample
456
457 Each face attribute has its own line. The @samp{[@var{x}]} field
458 before the attribute name indicates whether the attribute is
459 @dfn{enabled}; @samp{X} means that it is. You can enable or disable the
460 attribute by invoking that field. When the attribute is enabled, you
461 can change the attribute value in the usual ways.
462
463 On a black-and-white display, the colors you can use for the
464 background are @samp{black}, @samp{white}, @samp{gray}, @samp{gray1},
465 and @samp{gray3}. Emacs supports these shades of gray by using
466 background stipple patterns instead of a color.
467
468 Setting, saving and resetting a face work like the same operations for
469 options (@pxref{Changing an Option}).
470
471 A face can specify different appearances for different types of
472 display. For example, a face can make text red on a color display, but
473 use a bold font on a monochrome display. To specify multiple
474 appearances for a face, select @samp{Show Display Types} in the menu you
475 get from invoking @samp{[State]}.
476
477 @findex modify-face
478 Another more basic way to set the attributes of a specific face is
479 with @kbd{M-x modify-face}. This command reads the name of a face, then
480 reads the attributes one by one. For the color and stipple attributes,
481 the attribute's current value is the default---type just @key{RET} if
482 you don't want to change that attribute. Type @samp{none} if you want
483 to clear out the attribute.
484
485 @node Specific Customization
486 @subsubsection Customizing Specific Items
487
488 Instead of finding the options you want to change by moving down
489 through the structure of groups, you can specify the particular option,
490 face or group that you want to customize.
491
492 @table @kbd
493 @item M-x customize-option @key{RET} @var{option} @key{RET}
494 Set up a customization buffer with just one option, @var{option}.
495 @item M-x customize-face @key{RET} @var{face} @key{RET}
496 Set up a customization buffer with just one face, @var{face}.
497 @item M-x customize-group @key{RET} @var{group} @key{RET}
498 Set up a customization buffer with just one group, @var{group}.
499 @item M-x customize-apropos @key{RET} @var{regexp} @key{RET}
500 Set up a customization buffer with all the options, faces and groups
501 that match @var{regexp}.
502 @item M-x customize-saved
503 Set up a customization buffer containing all options and faces that you
504 have saved with customization buffers.
505 @item M-x customize-customized
506 Set up a customization buffer containing all options and faces that you
507 have customized but not saved.
508 @end table
509
510 @findex customize-option
511 If you want to alter a particular user option variable with the
512 customization buffer, and you know its name, you can use the command
513 @kbd{M-x customize-option} and specify the option name. This sets up
514 the customization buffer with just one option---the one that you asked
515 for. Editing, setting and saving the value work as described above, but
516 only for the specified option.
517
518 @findex customize-face
519 Likewise, you can modify a specific face, chosen by name, using
520 @kbd{M-x customize-face}.
521
522 @findex customize-group
523 You can also set up the customization buffer with a specific group,
524 using @kbd{M-x customize-group}. The immediate contents of the chosen
525 group, including option variables, faces, and other groups, all appear
526 as well. However, these subgroups' own contents start out hidden. You
527 can show their contents in the usual way, by invoking @samp{[Show]}.
528
529 @findex customize-apropos
530 To control more precisely what to customize, you can use @kbd{M-x
531 customize-apropos}. You specify a regular expression as argument; then
532 all options, faces and groups whose names match this regular expression
533 are set up in the customization buffer. If you specify an empty regular
534 expression, this includes @emph{all} groups, options and faces in the
535 customization buffer (but that takes a long time).
536
537 @findex customize-saved
538 @findex customize-customized
539 If you change option values and then decide the change was a mistake,
540 you can use two special commands to revisit your previous changes. Use
541 @kbd{customize-saved} to look at the options and faces that you have
542 saved. Use @kbd{M-x customize-customized} to look at the options and
543 faces that you have set but not saved.
173 544
174 @node Edit Options 545 @node Edit Options
175 @subsection Editing Variable Values 546 @subsection Editing Variable Values
176 547
177 @table @kbd 548 @table @kbd