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