Sync with r21-2-35.
[chise/xemacs-chise.git-] / info / xemacs.info-16
1 This is ../info/xemacs.info, produced by makeinfo version 4.0 from
2 xemacs/xemacs.texi.
3
4 INFO-DIR-SECTION XEmacs Editor
5 START-INFO-DIR-ENTRY
6 * XEmacs: (xemacs).             XEmacs Editor.
7 END-INFO-DIR-ENTRY
8
9    This file documents the XEmacs editor.
10
11    Copyright (C) 1985, 1986, 1988 Richard M. Stallman.  Copyright (C)
12 1991, 1992, 1993, 1994 Lucid, Inc.  Copyright (C) 1993, 1994 Sun
13 Microsystems, Inc.  Copyright (C) 1995 Amdahl Corporation.
14
15    Permission is granted to make and distribute verbatim copies of this
16 manual provided the copyright notice and this permission notice are
17 preserved on all copies.
18
19    Permission is granted to copy and distribute modified versions of
20 this manual under the conditions for verbatim copying, provided also
21 that the sections entitled "The GNU Manifesto", "Distribution" and "GNU
22 General Public License" are included exactly as in the original, and
23 provided that the entire resulting derived work is distributed under the
24 terms of a permission notice identical to this one.
25
26    Permission is granted to copy and distribute translations of this
27 manual into another language, under the above conditions for modified
28 versions, except that the sections entitled "The GNU Manifesto",
29 "Distribution" and "GNU General Public License" may be included in a
30 translation approved by the author instead of in the original English.
31
32 \1f
33 File: xemacs.info,  Node: Term Mode,  Next: Paging in Term,  Prev: Terminal emulator,  Up: Shell
34
35 Term Mode
36 ---------
37
38    Term uses Term mode, which has two input modes: In line mode, Term
39 basically acts like Shell mode.  *Note Shell Mode::.  In Char mode,
40 each character is sent directly to the inferior subshell, except for
41 the Term escape character, normally `C-c'.
42
43    To switch between line and char mode, use these commands:
44      findex term-char-mode
45
46 `C-c C-k'
47      Switch to line mode.  Do nothing if already in line mode.
48
49 `C-c C-j'
50      Switch to char mode.  Do nothing if already in char mode.
51
52    The following commands are only available in Char mode:
53 `C-c C-c'
54      Send a literal <C-c> to the sub-shell.
55
56 `C-c C-x'
57      A prefix command to conveniently access the global <C-x> commands.
58      For example, `C-c C-x o' invokes the global binding of `C-x o',
59      which is normally `other-window'.
60
61 \1f
62 File: xemacs.info,  Node: Paging in Term,  Prev: Term Mode,  Up: Shell
63
64 Paging in the terminal emulator
65 -------------------------------
66
67    Term mode has a pager feature.  When the pager is enabled, term mode
68 will pause at the end of each screenful.
69
70 `C-c C-q'
71      Toggles the pager feature:  Disables the pager if it is enabled,
72      and vice versa.  This works in both line and char modes.  If the
73      pager enabled, the mode-line contains the word `page'.
74
75    If the pager is enabled, and Term receives more than a screenful of
76 output since your last input, Term will enter More break mode.  This is
77 indicated by `**MORE**' in the mode-line.  Type a `Space' to display
78 the next screenful of output.  Type `?' to see your other options.  The
79 interface is similar to the Unix `more' program.
80
81 \1f
82 File: xemacs.info,  Node: Narrowing,  Next: Hardcopy,  Prev: Shell,  Up: Top
83
84 Narrowing
85 =========
86
87    "Narrowing" means focusing in on some portion of the buffer, making
88 the rest temporarily invisible and inaccessible.  Cancelling the
89 narrowing and making the entire buffer once again visible is called
90 "widening".  The amount of narrowing in effect in a buffer at any time
91 is called the buffer's "restriction".
92
93 `C-x n n'
94      Narrow down to between point and mark (`narrow-to-region').
95
96 `C-x n w'
97      Widen to make the entire buffer visible again (`widen').
98
99    Narrowing sometimes makes it easier to concentrate on a single
100 subroutine or paragraph by eliminating clutter.  It can also be used to
101 restrict the range of operation of a replace command or repeating
102 keyboard macro.  The word `Narrow' appears in the mode line whenever
103 narrowing is in effect.  When you have narrowed to a part of the
104 buffer, that part appears to be all there is.  You can't see the rest,
105 can't move into it (motion commands won't go outside the visible part),
106 and can't change it in any way.  However, the invisible text is not
107 gone; if you save the file, it will be saved.
108
109    The primary narrowing command is `C-x n n' (`narrow-to-region').  It
110 sets the current buffer's restrictions so that the text in the current
111 region remains visible but all text before the region or after the
112 region is invisible.  Point and mark do not change.
113
114    Because narrowing can easily confuse users who do not understand it,
115 `narrow-to-region' is normally a disabled command.  Attempting to use
116 this command asks for confirmation and gives you the option of enabling
117 it; once you enable the command, confirmation will no longer be
118 required.  *Note Disabling::.
119
120    To undo narrowing, use `C-x n w' (`widen').  This makes all text in
121 the buffer accessible again.
122
123    Use the `C-x =' command to get information on what part of the
124 buffer you narrowed down.  *Note Position Info::.
125
126 \1f
127 File: xemacs.info,  Node: Hardcopy,  Next: Recursive Edit,  Prev: Narrowing,  Up: Top
128
129 Hardcopy Output
130 ===============
131
132    The XEmacs commands for making hardcopy derive their names from the
133 Unix commands `print' and `lpr'.
134
135 `M-x print-buffer'
136      Print hardcopy of current buffer using Unix command `print'
137      (`lpr -p').  This command adds page headings containing the file
138      name and page number.
139
140 `M-x lpr-buffer'
141      Print hardcopy of current buffer using Unix command `lpr'.  This
142      command does not add page headings.
143
144 `M-x print-region'
145      Like `print-buffer', but prints only the current region.
146
147 `M-x lpr-region'
148      Like `lpr-buffer', but prints only the current region.
149
150    All the hardcopy commands pass extra switches to the `lpr' program
151 based on the value of the variable `lpr-switches'.  Its value should be
152 a list of strings, each string a switch starting with `-'.  For
153 example, the value could be `("-Pfoo")' to print on printer `foo'.
154
155 \1f
156 File: xemacs.info,  Node: Recursive Edit,  Next: Dissociated Press,  Prev: Hardcopy,  Up: Top
157
158 Recursive Editing Levels
159 ========================
160
161    A "recursive edit" is a situation in which you are using XEmacs
162 commands to perform arbitrary editing while in the middle of another
163 XEmacs command.  For example, when you type `C-r' inside a
164 `query-replace', you enter a recursive edit in which you can change the
165 current buffer.  When you exit from the recursive edit, you go back to
166 the `query-replace'.
167
168    "Exiting" a recursive edit means returning to the unfinished
169 command, which continues execution.  For example, exiting the recursive
170 edit requested by `C-r' in `query-replace' causes query replacing to
171 resume.  Exiting is done with `C-M-c' (`exit-recursive-edit').
172
173    You can also "abort" a recursive edit.  This is like exiting, but
174 also quits the unfinished command immediately.  Use the command `C-]'
175 (`abort-recursive-edit') for this.  *Note Quitting::.
176
177    The mode line shows you when you are in a recursive edit by
178 displaying square brackets around the parentheses that always surround
179 the major and minor mode names.  Every window's mode line shows the
180 square brackets, since XEmacs as a whole, rather than any particular
181 buffer, is in a recursive edit.
182
183    It is possible to be in recursive edits within recursive edits.  For
184 example, after typing `C-r' in a `query-replace', you might type a
185 command that entered the debugger.  In such a case, two or more sets of
186 square brackets appear in the mode line(s).  Exiting the inner
187 recursive edit (here with the debugger `c' command) resumes the
188 query-replace command where it called the debugger.  After the end of
189 the query-replace command, you would be able to exit the first
190 recursive edit.  Aborting exits only one level of recursive edit; it
191 returns to the command level of the previous recursive edit.  You can
192 then abort that one as well.
193
194    The command `M-x top-level' aborts all levels of recursive edits,
195 returning immediately to the top level command reader.
196
197    The text you edit inside the recursive edit need not be the same text
198 that you were editing at top level.  If the command that invokes the
199 recursive edit selects a different buffer first, that is the buffer you
200 will edit recursively.  You can switch buffers within the recursive edit
201 in the normal manner (as long as the buffer-switching keys have not been
202 rebound).  While you could theoretically do the rest of your editing
203 inside the recursive edit, including visiting files, this could have
204 surprising effects (such as stack overflow) from time to time.  It is
205 best if you always exit or abort a recursive edit when you no longer
206 need it.
207
208    In general, XEmacs tries to avoid using recursive edits.  It is
209 usually preferable to allow users to switch among the possible editing
210 modes in any order they like.  With recursive edits, the only way to get
211 to another state is to go "back" to the state that the recursive edit
212 was invoked from.
213
214 \1f
215 File: xemacs.info,  Node: Dissociated Press,  Next: CONX,  Prev: Recursive Edit,  Up: Top
216
217 Dissociated Press
218 =================
219
220    `M-x dissociated-press' is a command for scrambling a file of text
221 either word by word or character by character.  Starting from a buffer
222 of straight English, it produces extremely amusing output.  The input
223 comes from the current XEmacs buffer.  Dissociated Press writes its
224 output in a buffer named `*Dissociation*', and redisplays that buffer
225 after every couple of lines (approximately) to facilitate reading it.
226
227    `dissociated-press' asks every so often whether to continue
228 operating.  Answer `n' to stop it.  You can also stop at any time by
229 typing `C-g'.  The dissociation output remains in the `*Dissociation*'
230 buffer for you to copy elsewhere if you wish.
231
232    Dissociated Press operates by jumping at random from one point in the
233 buffer to another.  In order to produce plausible output rather than
234 gibberish, it insists on a certain amount of overlap between the end of
235 one run of consecutive words or characters and the start of the next.
236 That is, if it has just printed out `president' and then decides to
237 jump to a different point in the file, it might spot the `ent' in
238 `pentagon' and continue from there, producing `presidentagon'.  Long
239 sample texts produce the best results.
240
241    A positive argument to `M-x dissociated-press' tells it to operate
242 character by character, and specifies the number of overlap characters.
243 A negative argument tells it to operate word by word and specifies the
244 number of overlap words.  In this mode, whole words are treated as the
245 elements to be permuted, rather than characters.  No argument is
246 equivalent to an argument of two.  For your againformation, the output
247 goes only into the buffer `*Dissociation*'.  The buffer you start with
248 is not changed.
249
250    Dissociated Press produces nearly the same results as a Markov chain
251 based on a frequency table constructed from the sample text.  It is,
252 however, an independent, ignoriginal invention.  Dissociated Press
253 techniquitously copies several consecutive characters from the sample
254 between random choices, whereas a Markov chain would choose randomly for
255 each word or character.  This makes for more plausible sounding results
256 and runs faster.
257
258    It is a mustatement that too much use of Dissociated Press can be a
259 developediment to your real work.  Sometimes to the point of outragedy.
260 And keep dissociwords out of your documentation, if you want it to be
261 well userenced and properbose.  Have fun.  Your buggestions are welcome.
262
263 \1f
264 File: xemacs.info,  Node: CONX,  Next: Amusements,  Prev: Dissociated Press,  Up: Top
265
266 CONX
267 ====
268
269    Besides producing a file of scrambled text with Dissociated Press,
270 you can generate random sentences by using CONX.
271
272 `M-x conx'
273      Generate random sentences in the `*conx*' buffer.
274
275 `M-x conx-buffer'
276      Absorb the text in the current buffer into the `conx' database.
277
278 `M-x conx-init'
279      Forget the current word-frequency tree.
280
281 `M-x conx-load'
282      Load a `conx' database that has been previously saved with `M-x
283      conx-save'.
284
285 `M-x conx-region'
286      Absorb the text in the current buffer into the `conx' database.
287
288 `M-x conx-save'
289      Save the current `conx' database to a file for future retrieval.
290
291    Copy text from a buffer using `M-x conx-buffer' or `M-x conx-region'
292 and then type `M-x conx'.  Output is continuously generated until you
293 type <^G>. You can save the `conx' database to a file with `M-x
294 conx-save', which you can retrieve with `M-x conx-load'.  To clear the
295 database, use `M-x conx-init'.
296
297 \1f
298 File: xemacs.info,  Node: Amusements,  Next: Emulation,  Prev: CONX,  Up: Top
299
300 Other Amusements
301 ================
302
303    If you are a little bit bored, you can try `M-x hanoi'.  If you are
304 considerably bored, give it a numeric argument.  If you are very, very
305 bored, try an argument of 9.  Sit back and watch.
306
307    When you are frustrated, try the famous Eliza program.  Just do `M-x
308 doctor'.  End each input by typing `RET' twice.
309
310    When you are feeling strange, type `M-x yow'.
311
312 \1f
313 File: xemacs.info,  Node: Emulation,  Next: Customization,  Prev: Amusements,  Up: Top
314
315 Emulation
316 =========
317
318    XEmacs can be programmed to emulate (more or less) most other
319 editors.  Standard facilities can emulate these:
320
321 Viper (a vi emulator)
322      In XEmacs, Viper is the preferred emulation of vi within XEmacs.
323      Viper is designed to allow you to take advantage of the best
324      features of XEmacs while still doing your basic editing in a
325      familiar, vi-like fashion.  Viper provides various different
326      levels of vi emulation, from a quite complete emulation that
327      allows almost no access to native XEmacs commands, to an "expert"
328      mode that combines the most useful vi commands with the most
329      useful XEmacs commands.
330
331      To start Viper, put the command
332
333           (viper-mode)
334
335      in your init file.  *Note Init File::.
336
337      Viper comes with a separate manual that is provided standard with
338      the XEmacs distribution.
339
340 EDT (DEC VMS editor)
341      Turn on EDT emulation with `M-x edt-emulation-on'.  `M-x
342      edt-emulation-off' restores normal Emacs command bindings.
343
344      Most of the EDT emulation commands are keypad keys, and most
345      standard Emacs key bindings are still available.  The EDT
346      emulation rebindings are done in the global keymap, so there is no
347      problem switching buffers or major modes while in EDT emulation.
348
349 Gosling Emacs
350      Turn on emulation of Gosling Emacs (aka Unipress Emacs) with `M-x
351      set-gosmacs-bindings'.  This redefines many keys, mostly on the
352      `C-x' and `ESC' prefixes, to work as they do in Gosmacs.  `M-x
353      set-gnu-bindings' returns to normal XEmacs by rebinding the same
354      keys to the definitions they had at the time `M-x
355      set-gosmacs-bindings' was done.
356
357      It is also possible to run Mocklisp code written for Gosling Emacs.
358      *Note Mocklisp::.
359
360 \1f
361 File: xemacs.info,  Node: Customization,  Next: Quitting,  Prev: Emulation,  Up: Top
362
363 Customization
364 *************
365
366    This chapter talks about various topics relevant to adapting the
367 behavior of Emacs in minor ways.
368
369    All kinds of customization affect only the particular Emacs job that
370 you do them in.  They are completely lost when you kill the Emacs job,
371 and have no effect on other Emacs jobs you may run at the same time or
372 later.  The only way an Emacs job can affect anything outside of it is
373 by writing a file; in particular, the only way to make a customization
374 `permanent' is to put something in your init file or other appropriate
375 file to do the customization in each session.  *Note Init File::.
376
377 * Menu:
378
379 * Minor Modes::     Each minor mode is one feature you can turn on
380                      independently of any others.
381 * Variables::       Many Emacs commands examine Emacs variables
382                      to decide what to do; by setting variables,
383                      you can control their functioning.
384 * Keyboard Macros:: A keyboard macro records a sequence of keystrokes
385                      to be replayed with a single command.
386 * Key Bindings::    The keymaps say what command each key runs.
387                      By changing them, you can "redefine keys".
388 * Syntax::          The syntax table controls how words and expressions
389                      are parsed.
390 * Init File::       How to write common customizations in the init file.
391 * Audible Bell::    Changing how Emacs sounds the bell.
392 * Faces::           Changing the fonts and colors of a region of text.
393 * Frame Components::  Controlling the presence and positions of the
394                      menubar, toolbars, and gutters.
395 * X Resources::     X resources controlling various aspects of the
396                      behavior of XEmacs.
397
398 \1f
399 File: xemacs.info,  Node: Minor Modes,  Next: Variables,  Up: Customization
400
401 Minor Modes
402 ===========
403
404    Minor modes are options which you can use or not.  For example, Auto
405 Fill mode is a minor mode in which <SPC> breaks lines between words as
406 you type.  All the minor modes are independent of each other and of the
407 selected major mode.  Most minor modes inform you in the mode line when
408 they are on; for example, `Fill' in the mode line means that Auto Fill
409 mode is on.
410
411    Append `-mode' to the name of a minor mode to get the name of a
412 command function that turns the mode on or off.  Thus, the command to
413 enable or disable Auto Fill mode is called `M-x auto-fill-mode'.  These
414 commands are usually invoked with `M-x', but you can bind keys to them
415 if you wish.  With no argument, the function turns the mode on if it was
416 off and off if it was on.  This is known as "toggling".  A positive
417 argument always turns the mode on, and an explicit zero argument or a
418 negative argument always turns it off.
419
420    Auto Fill mode allows you to enter filled text without breaking lines
421 explicitly.  Emacs inserts newlines as necessary to prevent lines from
422 becoming too long.  *Note Filling::.
423
424    Overwrite mode causes ordinary printing characters to replace
425 existing text instead of moving it to the right.  For example, if point
426 is in front of the `B' in `FOOBAR', and you type a `G' in Overwrite
427 mode, it changes to `FOOGAR', instead of `FOOGBAR'.
428
429    Abbrev mode allows you to define abbreviations that automatically
430 expand as you type them.  For example, `amd' might expand to `abbrev
431 mode'.  *Note Abbrevs::, for full information.
432
433 \1f
434 File: xemacs.info,  Node: Variables,  Next: Keyboard Macros,  Prev: Minor Modes,  Up: Customization
435
436 Variables
437 =========
438
439    A "variable" is a Lisp symbol which has a value.  Variable names can
440 contain any characters, but by convention they are words separated by
441 hyphens.  A variable can also have a documentation string, which
442 describes what kind of value it should have and how the value will be
443 used.
444
445    Lisp allows any variable to have any kind of value, but most
446 variables that Emacs uses require a value of a certain type.  Often the
447 value has to be a string or a number.  Sometimes we say that a certain
448 feature is turned on if a variable is "non-`nil'," meaning that if the
449 variable's value is `nil', the feature is off, but the feature is on
450 for any other value.  The conventional value to turn on the
451 feature--since you have to pick one particular value when you set the
452 variable--is `t'.
453
454    Emacs uses many Lisp variables for internal recordkeeping, as any
455 Lisp program must, but the most interesting variables for you are the
456 ones that exist for the sake of customization.  Emacs does not
457 (usually) change the values of these variables; instead, you set the
458 values, and thereby alter and control the behavior of certain Emacs
459 commands.  These variables are called "options".  Most options are
460 documented in this manual and appear in the Variable Index (*note
461 Variable Index::).
462
463    One example of a variable which is an option is `fill-column', which
464 specifies the position of the right margin (as a number of characters
465 from the left margin) to be used by the fill commands (*note Filling::).
466
467 * Menu:
468
469 * Examining::           Examining or setting one variable's value.
470 * Easy Customization::  Convenient and easy customization of variables.
471 * Edit Options::        Examining or editing list of all variables' values.
472 * Locals::              Per-buffer values of variables.
473 * File Variables::      How files can specify variable values.
474
475 \1f
476 File: xemacs.info,  Node: Examining,  Next: Easy Customization,  Up: Variables
477
478 Examining and Setting Variables
479 -------------------------------
480
481 `C-h v'
482 `M-x describe-variable'
483      Print the value and documentation of a variable.
484
485 `M-x set-variable'
486      Change the value of a variable.
487
488    To examine the value of a single variable, use `C-h v'
489 (`describe-variable'), which reads a variable name using the
490 minibuffer, with completion.  It prints both the value and the
491 documentation of the variable.
492
493      C-h v fill-column <RET>
494
495 prints something like:
496
497      fill-column's value is 75
498      
499      Documentation:
500      *Column beyond which automatic line-wrapping should happen.
501      Automatically becomes local when set in any fashion.
502
503 The star at the beginning of the documentation indicates that this
504 variable is an option.  `C-h v' is not restricted to options; it allows
505 any variable name.
506
507    If you know which option you want to set, you can use `M-x
508 set-variable' to set it.  This prompts for the variable name in the
509 minibuffer (with completion), and then prompts for a Lisp expression
510 for the new value using the minibuffer a second time.  For example,
511
512      M-x set-variable <RET> fill-column <RET> 75 <RET>
513
514 sets `fill-column' to 75, as if you had executed the Lisp expression
515 `(setq fill-column 75)'.
516
517    Setting variables in this way, like all means of customizing Emacs
518 except where explicitly stated, affects only the current Emacs session.
519
520 \1f
521 File: xemacs.info,  Node: Easy Customization,  Next: Edit Options,  Prev: Examining,  Up: Variables
522
523 Easy Customization Interface
524 ----------------------------
525
526    A convenient way to find the user option variables that you want to
527 change, and then change them, is with `M-x customize'.  This command
528 creates a "customization buffer" with which you can browse through the
529 Emacs user options in a logically organized structure, then edit and
530 set their values.  You can also use the customization buffer to save
531 settings permanently.  (Not all Emacs user options are included in this
532 structure as of yet, but we are adding the rest.)
533
534 * Menu:
535
536 * Groups: Customization Groups.
537                              How options are classified in a structure.
538 * Changing an Option::       How to edit a value and set an option.
539 * Face Customization::       How to edit the attributes of a face.
540 * Specific Customization::   Making a customization buffer for specific
541                                 options, faces, or groups.
542
543 \1f
544 File: xemacs.info,  Node: Customization Groups,  Next: Changing an Option,  Up: Easy Customization
545
546 Customization Groups
547 ....................
548
549    For customization purposes, user options are organized into "groups"
550 to help you find them.  Groups are collected into bigger groups, all
551 the way up to a master group called `Emacs'.
552
553    `M-x customize' creates a customization buffer that shows the
554 top-level `Emacs' group and the second-level groups immediately under
555 it.  It looks like this, in part:
556
557      /- Emacs group: ---------------------------------------------------\
558            [State]: visible group members are all at standard settings.
559         Customization of the One True Editor.
560         See also [Manual].
561      
562       [Open] Editing group
563      Basic text editing facilities.
564      
565       [Open] External group
566      Interfacing to external utilities.
567      
568      MORE SECOND-LEVEL GROUPS
569      
570      \- Emacs group end ------------------------------------------------/
571
572 This says that the buffer displays the contents of the `Emacs' group.
573 The other groups are listed because they are its contents.  But they
574 are listed differently, without indentation and dashes, because _their_
575 contents are not included.  Each group has a single-line documentation
576 string; the `Emacs' group also has a `[State]' line.
577
578    Most of the text in the customization buffer is read-only, but it
579 typically includes some "editable fields" that you can edit.  There are
580 also "active fields"; this means a field that does something when you
581 "invoke" it.  To invoke an active field, either click on it with
582 `Mouse-1', or move point to it and type <RET>.
583
584    For example, the phrase `[Open]' that appears in a second-level
585 group is an active field.  Invoking the `[Open]' field for a group
586 opens up a new customization buffer, which shows that group and its
587 contents.  This field is a kind of hypertext link to another group.
588
589    The `Emacs' group does not include any user options itself, but
590 other groups do.  By examining various groups, you will eventually find
591 the options and faces that belong to the feature you are interested in
592 customizing.  Then you can use the customization buffer to set them.
593
594    You can view the structure of customization groups on a larger scale
595 with `M-x customize-browse'.  This command creates a special kind of
596 customization buffer which shows only the names of the groups (and
597 options and faces), and their structure.
598
599    In this buffer, you can show the contents of a group by invoking
600 `[+]'.  When the group contents are visible, this button changes to
601 `[-]'; invoking that hides the group contents.
602
603    Each group, option or face name in this buffer has an active field
604 which says `[Group]', `[Option]' or `[Face]'.  Invoking that active
605 field creates an ordinary customization buffer showing just that group
606 and its contents, just that option, or just that face.  This is the way
607 to set values in it.
608
609 \1f
610 File: xemacs.info,  Node: Changing an Option,  Next: Face Customization,  Prev: Customization Groups,  Up: Easy Customization
611
612 Changing an Option
613 ..................
614
615    Here is an example of what a user option looks like in the
616 customization buffer:
617
618      Kill Ring Max: [Hide] 30
619         [State]: this option is unchanged from its standard setting.
620      Maximum length of kill ring before oldest elements are thrown away.
621
622    The text following `[Hide]', `30' in this case, indicates the
623 current value of the option.  If you see `[Show]' instead of `[Hide]',
624 it means that the value is hidden; the customization buffer initially
625 hides values that take up several lines.  Invoke `[Show]' to show the
626 value.
627
628    The line after the option name indicates the "customization state"
629 of the option: in the example above, it says you have not changed the
630 option yet.  The word `[State]' at the beginning of this line is
631 active; you can get a menu of various operations by invoking it with
632 `Mouse-1' or <RET>.  These operations are essential for customizing the
633 variable.
634
635    The line after the `[State]' line displays the beginning of the
636 option's documentation string.  If there are more lines of
637 documentation, this line ends with `[More]'; invoke this to show the
638 full documentation string.
639
640    To enter a new value for `Kill Ring Max', move point to the value
641 and edit it textually.  For example, you can type `M-d', then insert
642 another number.
643
644    When you begin to alter the text, you will see the `[State]' line
645 change to say that you have edited the value:
646
647      [State]: you have edited the value as text, but not set the option.
648
649    Editing the value does not actually set the option variable.  To do
650 that, you must "set" the option.  To do this, invoke the word `[State]'
651 and choose `Set for Current Session'.
652
653    The state of the option changes visibly when you set it:
654
655      [State]: you have set this option, but not saved it for future sessions.
656
657    You don't have to worry about specifying a value that is not valid;
658 setting the option checks for validity and will not really install an
659 unacceptable value.
660
661    While editing a value or field that is a file name, directory name,
662 command name, or anything else for which completion is defined, you can
663 type `M-<TAB>' (`widget-complete') to do completion.
664
665    Some options have a small fixed set of possible legitimate values.
666 These options don't let you edit the value textually.  Instead, an
667 active field `[Value Menu]' appears before the value; invoke this field
668 to edit the value.  For a boolean "on or off" value, the active field
669 says `[Toggle]', and it changes to the other value.  `[Value Menu]' and
670 `[Toggle]' edit the buffer; the changes take effect when you use the
671 `Set for Current Session' operation.
672
673    Some options have values with complex structure.  For example, the
674 value of `load-path' is a list of directories.  Here is how it appears
675 in the customization buffer:
676
677      Load Path:
678      [INS] [DEL] [Current dir?]: /usr/local/share/emacs/19.34.94/site-lisp
679      [INS] [DEL] [Current dir?]: /usr/local/share/emacs/site-lisp
680      [INS] [DEL] [Current dir?]: /usr/local/share/emacs/19.34.94/leim
681      [INS] [DEL] [Current dir?]: /usr/local/share/emacs/19.34.94/lisp
682      [INS] [DEL] [Current dir?]: /build/emacs/e19/lisp
683      [INS] [DEL] [Current dir?]: /build/emacs/e19/lisp/gnus
684      [INS]
685         [State]: this item has been changed outside the customization buffer.
686      List of directories to search for files to load....
687
688 Each directory in the list appears on a separate line, and each line has
689 several editable or active fields.
690
691    You can edit any of the directory names.  To delete a directory from
692 the list, invoke `[DEL]' on that line.  To insert a new directory in
693 the list, invoke `[INS]' at the point where you want to insert it.
694
695    You can also invoke `[Current dir?]' to switch between including a
696 specific named directory in the path, and including `nil' in the path.
697 (`nil' in a search path means "try the current directory.")
698
699    Two special commands, <TAB> and `S-<TAB>', are useful for moving
700 through the customization buffer.  <TAB> (`widget-forward') moves
701 forward to the next active or editable field; `S-<TAB>'
702 (`widget-backward') moves backward to the previous active or editable
703 field.
704
705    Typing <RET> on an editable field also moves forward, just like
706 <TAB>.  The reason for this is that people have a tendency to type
707 <RET> when they are finished editing a field.  If you have occasion to
708 insert a newline in an editable field, use `C-o' or `C-q C-j',
709
710    Setting the option changes its value in the current Emacs session;
711 "saving" the value changes it for future sessions as well.  This works
712 by writing code into your init file so as to set the option variable
713 again each time you start Emacs.  *Note Init File::.  To save the
714 option, invoke `[State]' and select the `Save for Future Sessions'
715 operation.
716
717    You can also restore the option to its standard value by invoking
718 `[State]' and selecting the `Reset' operation.  There are actually
719 three reset operations:
720
721 `Reset to Current'
722      If you have made some modifications and not yet set the option,
723      this restores the text in the customization buffer to match the
724      actual value.
725
726 `Reset to Saved'
727      This restores the value of the option to the last saved value, and
728      updates the text accordingly.
729
730 `Reset to Standard Settings'
731      This sets the option to its standard value, and updates the text
732      accordingly.  This also eliminates any saved value for the option,
733      so that you will get the standard value in future Emacs sessions.
734
735    The state of a group indicates whether anything in that group has
736 been edited, set or saved.  You can select `Set for Current Session',
737 `Save for Future Sessions' and the various kinds of `Reset' operation
738 for the group; these operations on the group apply to all options in
739 the group and its subgroups.
740
741    Near the top of the customization buffer there are two lines
742 containing several active fields:
743
744       [Set] [Save] [Reset]  [Done]
745
746 Invoking `[Done]' buries this customization buffer.  Each of the other
747 fields performs an operation--set, save or reset--on each of the items
748 in the buffer that could meaningfully be set, saved or reset.
749
750 \1f
751 File: xemacs.info,  Node: Face Customization,  Next: Specific Customization,  Prev: Changing an Option,  Up: Easy Customization
752
753 Customizing Faces
754 .................
755
756    In addition to user options, some customization groups also include
757 faces.  When you show the contents of a group, both the user options and
758 the faces in the group appear in the customization buffer.  Here is an
759 example of how a face looks:
760
761      Custom Changed Face: (sample)
762         [State]: this face is unchanged from its standard setting.
763      Face used when the customize item has been changed.
764      Parent groups: [Custom Magic Faces]
765      Attributes: [ ] Bold: [Toggle]  off (nil)
766                  [ ] Italic: [Toggle]  off (nil)
767                  [ ] Underline: [Toggle]  off (nil)
768                  [ ] Foreground: white       (sample)
769                  [ ] Background: blue        (sample)
770                  [ ] Inverse: [Toggle]  off (nil)
771                  [ ] Stipple:
772                  [ ] Font Family:
773                  [ ] Size:
774                  [ ] Strikethru: off
775
776    Each face attribute has its own line.  The `[X]' field before the
777 attribute name indicates whether the attribute is "enabled"; `X' means
778 that it is.  You can enable or disable the attribute by invoking that
779 field.  When the attribute is enabled, you can change the attribute
780 value in the usual ways.
781
782    Setting, saving and resetting a face work like the same operations
783 for options (*note Changing an Option::).
784
785    A face can specify different appearances for different types of
786 display.  For example, a face can make text red on a color display, but
787 use a bold font on a monochrome display.  To specify multiple
788 appearances for a face, select `Show Display Types' in the menu you get
789 from invoking `[State]'.
790
791 \1f
792 File: xemacs.info,  Node: Specific Customization,  Prev: Face Customization,  Up: Easy Customization
793
794 Customizing Specific Items
795 ..........................
796
797    Instead of finding the options you want to change by moving down
798 through the structure of groups, you can specify the particular option,
799 face or group that you want to customize.
800
801 `M-x customize-option <RET> OPTION <RET>'
802      Set up a customization buffer with just one option, OPTION.
803
804 `M-x customize-face <RET> FACE <RET>'
805      Set up a customization buffer with just one face, FACE.
806
807 `M-x customize-group <RET> GROUP <RET>'
808      Set up a customization buffer with just one group, GROUP.
809
810 `M-x customize-apropos <RET> REGEXP <RET>'
811      Set up a customization buffer with all the options, faces and
812      groups that match REGEXP.
813
814 `M-x customize-saved'
815      Set up a customization buffer containing all options and faces
816      that you have saved with customization buffers.
817
818 `M-x customize-customized'
819      Set up a customization buffer containing all options and faces
820      that you have customized but not saved.
821
822    If you want to alter a particular user option variable with the
823 customization buffer, and you know its name, you can use the command
824 `M-x customize-option' and specify the option name.  This sets up the
825 customization buffer with just one option--the one that you asked for.
826 Editing, setting and saving the value work as described above, but only
827 for the specified option.
828
829    Likewise, you can modify a specific face, chosen by name, using `M-x
830 customize-face'.
831
832    You can also set up the customization buffer with a specific group,
833 using `M-x customize-group'.  The immediate contents of the chosen
834 group, including option variables, faces, and other groups, all appear
835 as well.  However, these subgroups' own contents start out hidden.  You
836 can show their contents in the usual way, by invoking `[Show]'.
837
838    To control more precisely what to customize, you can use `M-x
839 customize-apropos'.  You specify a regular expression as argument; then
840 all options, faces and groups whose names match this regular expression
841 are set up in the customization buffer.  If you specify an empty regular
842 expression, this includes _all_ groups, options and faces in the
843 customization buffer (but that takes a long time).
844
845    If you change option values and then decide the change was a mistake,
846 you can use two special commands to revisit your previous changes.  Use
847 `customize-saved' to look at the options and faces that you have saved.
848 Use `M-x customize-customized' to look at the options and faces that
849 you have set but not saved.
850
851 \1f
852 File: xemacs.info,  Node: Edit Options,  Next: Locals,  Prev: Easy Customization,  Up: Variables
853
854 Editing Variable Values
855 -----------------------
856
857 `M-x list-options'
858      Display a buffer listing names, values, and documentation of all
859      options.
860
861 `M-x edit-options'
862      Change option values by editing a list of options.
863
864    `M-x list-options' displays a list of all Emacs option variables in
865 an Emacs buffer named `*List Options*'.  Each option is shown with its
866 documentation and its current value.  Here is what a portion of it might
867 look like:
868
869      ;; exec-path:
870      ("." "/usr/local/bin" "/usr/ucb" "/bin" "/usr/bin" "/u2/emacs/etc")
871      *List of directories to search programs to run in subprocesses.
872      Each element is a string (directory name)
873      or nil (try the default directory).
874      ;;
875      ;; fill-column:
876      75
877      *Column beyond which automatic line-wrapping should happen.
878      Automatically becomes local when set in any fashion.
879      ;;
880
881    `M-x edit-options' goes one step further and immediately selects the
882 `*List Options*' buffer; this buffer uses the major mode Options mode,
883 which provides commands that allow you to point at an option and change
884 its value:
885
886 `s'
887      Set the variable point is in or near to a new value read using the
888      minibuffer.
889
890 `x'
891      Toggle the variable point is in or near: if the value was `nil',
892      it becomes `t'; otherwise it becomes `nil'.
893
894 `1'
895      Set the variable point is in or near to `t'.
896
897 `0'
898      Set the variable point is in or near to `nil'.
899
900 `n'
901 `p'
902      Move to the next or previous variable.
903
904 \1f
905 File: xemacs.info,  Node: Locals,  Next: File Variables,  Prev: Edit Options,  Up: Variables
906
907 Local Variables
908 ---------------
909
910 `M-x make-local-variable'
911      Make a variable have a local value in the current buffer.
912
913 `M-x kill-local-variable'
914      Make a variable use its global value in the current buffer.
915
916 `M-x make-variable-buffer-local'
917      Mark a variable so that setting it will make it local to the
918      buffer that is current at that time.
919
920    You can make any variable "local" to a specific Emacs buffer.  This
921 means that the variable's value in that buffer is independent of its
922 value in other buffers.  A few variables are always local in every
923 buffer.  All other Emacs variables have a "global" value which is in
924 effect in all buffers that have not made the variable local.
925
926    Major modes always make the variables they set local to the buffer.
927 This is why changing major modes in one buffer has no effect on other
928 buffers.
929
930    `M-x make-local-variable' reads the name of a variable and makes it
931 local to the current buffer.  Further changes in this buffer will not
932 affect others, and changes in the global value will not affect this
933 buffer.
934
935    `M-x make-variable-buffer-local' reads the name of a variable and
936 changes the future behavior of the variable so that it automatically
937 becomes local when it is set.  More precisely, once you have marked a
938 variable in this way, the usual ways of setting the variable will
939 automatically invoke `make-local-variable' first.  We call such
940 variables "per-buffer" variables.
941
942    Some important variables have been marked per-buffer already.  They
943 include `abbrev-mode', `auto-fill-function', `case-fold-search',
944 `comment-column', `ctl-arrow', `fill-column', `fill-prefix',
945 `indent-tabs-mode', `left-margin',
946 `mode-line-format', `overwrite-mode', `selective-display-ellipses',
947 `selective-display', `tab-width', and `truncate-lines'.  Some other
948 variables are always local in every buffer, but they are used for
949 internal purposes.
950
951    Note: the variable `auto-fill-function' was formerly named
952 `auto-fill-hook'.
953
954    If you want a variable to cease to be local to the current buffer,
955 call `M-x kill-local-variable' and provide the name of a variable to
956 the prompt.  The global value of the variable is again in effect in
957 this buffer.  Setting the major mode kills all the local variables of
958 the buffer.
959
960    To set the global value of a variable, regardless of whether the
961 variable has a local value in the current buffer, you can use the Lisp
962 function `setq-default'.  It works like `setq'.  If there is a local
963 value in the current buffer, the local value is not affected by
964 `setq-default'; thus, the new global value may not be visible until you
965 switch to another buffer, as in the case of:
966
967      (setq-default fill-column 75)
968
969 `setq-default' is the only way to set the global value of a variable
970 that has been marked with `make-variable-buffer-local'.
971
972    Programs can look at a variable's default value with `default-value'.
973 This function takes a symbol as an argument and returns its default
974 value.  The argument is evaluated; usually you must quote it
975 explicitly, as in the case of:
976
977      (default-value 'fill-column)
978
979 \1f
980 File: xemacs.info,  Node: File Variables,  Prev: Locals,  Up: Variables
981
982 Local Variables in Files
983 ------------------------
984
985    A file can contain a "local variables list", which specifies the
986 values to use for certain Emacs variables when that file is edited.
987 Visiting the file checks for a local variables list and makes each
988 variable in the list local to the buffer in which the file is visited,
989 with the value specified in the file.
990
991    A local variables list goes near the end of the file, in the last
992 page.  (It is often best to put it on a page by itself.)  The local
993 variables list starts with a line containing the string `Local
994 Variables:', and ends with a line containing the string `End:'.  In
995 between come the variable names and values, one set per line, as
996 `VARIABLE: VALUE'.  The VALUEs are not evaluated; they are used
997 literally.
998
999    The line which starts the local variables list does not have to say
1000 just `Local Variables:'.  If there is other text before `Local
1001 Variables:', that text is called the "prefix", and if there is other
1002 text after, that is called the "suffix".  If a prefix or suffix are
1003 present, each entry in the local variables list should have the prefix
1004 before it and the suffix after it.  This includes the `End:' line.  The
1005 prefix and suffix are included to disguise the local variables list as
1006 a comment so the compiler or text formatter  will ignore it.  If you do
1007 not need to disguise the local variables list as a comment in this way,
1008 there is no need to include a prefix or a suffix.
1009
1010    Two "variable" names are special in a local variables list: a value
1011 for the variable `mode' sets the major mode, and a value for the
1012 variable `eval' is simply evaluated as an expression and the value is
1013 ignored.  These are not real variables; setting them in any other
1014 context does not have the same effect.  If `mode' is used in a local
1015 variables list, it should be the first entry in the list.
1016
1017    Here is an example of a local variables list:
1018      ;;; Local Variables: ***
1019      ;;; mode:lisp ***
1020      ;;; comment-column:0 ***
1021      ;;; comment-start: ";;; "  ***
1022      ;;; comment-end:"***" ***
1023      ;;; End: ***
1024
1025    Note that the prefix is `;;; ' and the suffix is ` ***'.  Note also
1026 that comments in the file begin with and end with the same strings.
1027 Presumably the file contains code in a language which is enough like
1028 Lisp for Lisp mode to be useful but in which comments start and end
1029 differently.  The prefix and suffix are used in the local variables
1030 list to make the list look like several lines of comments when the
1031 compiler or interpreter for that language reads the file.
1032
1033    The start of the local variables list must be no more than 3000
1034 characters from the end of the file, and must be in the last page if the
1035 file is divided into pages.  Otherwise, Emacs will not notice it is
1036 there.  The purpose is twofold: a stray `Local Variables:' not in the
1037 last page does not confuse Emacs, and Emacs never needs to search a
1038 long file that contains no page markers and has no local variables list.
1039
1040    You may be tempted to turn on Auto Fill mode with a local variable
1041 list.  That is inappropriate.  Whether you use Auto Fill mode or not is
1042 a matter of personal taste, not a matter of the contents of particular
1043 files.  If you want to use Auto Fill, set up major mode hooks with your
1044 file file to turn it on (when appropriate) for you alone (*note Init
1045 File::).  Don't try to use a local variable list that would impose your
1046 taste on everyone working with the file.
1047
1048    XEmacs allows you to specify local variables in the first line of a
1049 file, in addition to specifying them in the `Local Variables' section
1050 at the end of a file.
1051
1052    If the first line of a file contains two occurrences of ``-*-'',
1053 XEmacs uses the information between them to determine what the major
1054 mode and variable settings should be.  For example, these are all legal:
1055
1056              ;;; -*- mode: emacs-lisp -*-
1057              ;;; -*- mode: postscript; version-control: never -*-
1058              ;;; -*- tags-file-name: "/foo/bar/TAGS" -*-
1059
1060    For historical reasons, the syntax ``-*- modename -*-'' is allowed
1061 as well; for example, you can use:
1062
1063              ;;; -*- emacs-lisp -*-
1064
1065    The variable `enable-local-variables' controls the use of local
1066 variables lists in files you visit.  The value can be `t', `nil', or
1067 something else.  A value of `t' means local variables lists are obeyed;
1068 `nil' means they are ignored; anything else means query.
1069
1070    The command `M-x normal-mode' always obeys local variables lists and
1071 ignores this variable.
1072
1073 \1f
1074 File: xemacs.info,  Node: Keyboard Macros,  Next: Key Bindings,  Prev: Variables,  Up: Customization
1075
1076 Keyboard Macros
1077 ===============
1078
1079    A "keyboard macro" is a command defined by the user to abbreviate a
1080 sequence of keys.  For example, if you discover that you are about to
1081 type `C-n C-d' forty times, you can speed your work by defining a
1082 keyboard macro to invoke `C-n C-d' and calling it with a repeat count
1083 of forty.
1084
1085 `C-x ('
1086      Start defining a keyboard macro (`start-kbd-macro').
1087
1088 `C-x )'
1089      End the definition of a keyboard macro (`end-kbd-macro').
1090
1091 `C-x e'
1092      Execute the most recent keyboard macro (`call-last-kbd-macro').
1093
1094 `C-u C-x ('
1095      Re-execute last keyboard macro, then add more keys to its
1096      definition.
1097
1098 `C-x q'
1099      When this point is reached during macro execution, ask for
1100      confirmation (`kbd-macro-query').
1101
1102 `M-x name-last-kbd-macro'
1103      Give a command name (for the duration of the session) to the most
1104      recently defined keyboard macro.
1105
1106 `M-x insert-kbd-macro'
1107      Insert in the buffer a keyboard macro's definition, as Lisp code.
1108
1109    Keyboard macros differ from other Emacs commands in that they are
1110 written in the Emacs command language rather than in Lisp.  This makes
1111 it easier for the novice to write them and makes them more convenient as
1112 temporary hacks.  However, the Emacs command language is not powerful
1113 enough as a programming language to be useful for writing anything
1114 general or complex.  For such things, Lisp must be used.
1115
1116    You define a keyboard macro by executing the commands which are its
1117 definition.  Put differently, as you are defining a keyboard macro, the
1118 definition is being executed for the first time.  This way, you see
1119 what the effects of your commands are, and don't have to figure them
1120 out in your head.  When you are finished, the keyboard macro is defined
1121 and also has been executed once.  You can then execute the same set of
1122 commands again by invoking the macro.
1123
1124 * Menu:
1125
1126 * Basic Kbd Macro::     Defining and running keyboard macros.
1127 * Save Kbd Macro::      Giving keyboard macros names; saving them in files.
1128 * Kbd Macro Query::     Keyboard macros that do different things each use.
1129
1130 \1f
1131 File: xemacs.info,  Node: Basic Kbd Macro,  Next: Save Kbd Macro,  Up: Keyboard Macros
1132
1133 Basic Use
1134 ---------
1135
1136    To start defining a keyboard macro, type `C-x ('
1137 (`start-kbd-macro').  From then on, anything you type continues to be
1138 executed, but also becomes part of the definition of the macro.  `Def'
1139 appears in the mode line to remind you of what is going on.  When you
1140 are finished, the `C-x )' command (`end-kbd-macro') terminates the
1141 definition, without becoming part of it.
1142
1143    For example,
1144
1145      C-x ( M-f foo C-x )
1146
1147 defines a macro to move forward a word and then insert `foo'.
1148
1149    You can give `C-x )' a repeat count as an argument, in which case it
1150 repeats the macro that many times right after defining it, but defining
1151 the macro counts as the first repetition (since it is executed as you
1152 define it).  If you give `C-x )' an argument of 4, it executes the
1153 macro immediately 3 additional times.  An argument of zero to `C-x e'
1154 or `C-x )' means repeat the macro indefinitely (until it gets an error
1155 or you type `C-g').
1156
1157    Once you have defined a macro, you can invoke it again with the `C-x
1158 e' command (`call-last-kbd-macro').  You can give the command a repeat
1159 count numeric argument to execute the macro many times.
1160
1161    To repeat an operation at regularly spaced places in the text,
1162 define a macro and include as part of the macro the commands to move to
1163 the next place you want to use it.  For example, if you want to change
1164 each line, you should position point at the start of a line, and define
1165 a macro to change that line and leave point at the start of the next
1166 line.  Repeating the macro will then operate on successive lines.
1167
1168    After you have terminated the definition of a keyboard macro, you
1169 can add to the end of its definition by typing `C-u C-x ('.  This is
1170 equivalent to plain `C-x (' followed by retyping the whole definition
1171 so far.  As a consequence it re-executes the macro as previously
1172 defined.
1173