Sync up with r21-2-44.
[chise/xemacs-chise.git-] / info / xemacs.info-18
1 This is ../info/xemacs.info, produced by makeinfo version 4.0b 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: Keymaps,  Next: Rebinding,  Up: Key Bindings
34
35 Keymaps
36 -------
37
38    The bindings between characters and command functions are recorded in
39 data structures called "keymaps".  Emacs has many of these.  One, the
40 "global" keymap, defines the meanings of the single-character keys that
41 are defined regardless of major mode.  It is the value of the variable
42 `global-map'.
43
44    Each major mode has another keymap, its "local keymap", which
45 contains overriding definitions for the single-character keys that are
46 redefined in that mode.  Each buffer records which local keymap is
47 installed for it at any time, and the current buffer's local keymap is
48 the only one that directly affects command execution.  The local keymaps
49 for Lisp mode, C mode, and many other major modes always exist even when
50 not in use.  They are the values of the variables `lisp-mode-map',
51 `c-mode-map', and so on.  For less frequently used major modes, the
52 local keymap is sometimes constructed only when the mode is used for the
53 first time in a session, to save space.
54
55    There are local keymaps for the minibuffer, too; they contain various
56 completion and exit commands.
57
58    * `minibuffer-local-map' is used for ordinary input (no completion).
59
60    * `minibuffer-local-ns-map' is similar, except that <SPC> exits just
61      like <RET>.  This is used mainly for Mocklisp compatibility.
62
63    * `minibuffer-local-completion-map' is for permissive completion.
64
65    * `minibuffer-local-must-match-map' is for strict completion and for
66      cautious completion.
67
68    * `repeat-complex-command-map' is for use in `C-x <ESC>'.
69
70    * `isearch-mode-map' contains the bindings of the special keys which
71      are bound in the pseudo-mode entered with `C-s' and `C-r'.
72
73    Finally, each prefix key has a keymap which defines the key sequences
74 that start with it.  For example, `ctl-x-map' is the keymap used for
75 characters following a `C-x'.
76
77    * `ctl-x-map' is the variable name for the map used for characters
78      that follow `C-x'.
79
80    * `help-map' is used for characters that follow `C-h'.
81
82    * `esc-map' is for characters that follow <ESC>. All Meta characters
83      are actually defined by this map.
84
85    * `ctl-x-4-map' is for characters that follow `C-x 4'.
86
87    * `mode-specific-map' is for characters that follow `C-c'.
88
89    The definition of a prefix key is the keymap to use for looking up
90 the following character.  Sometimes the definition is actually a Lisp
91 symbol whose function definition is the following character keymap.  The
92 effect is the same, but it provides a command name for the prefix key
93 that you can use as a description of what the prefix key is for.  Thus
94 the binding of `C-x' is the symbol `Ctl-X-Prefix', whose function
95 definition is the keymap for `C-x' commands, the value of `ctl-x-map'.
96
97    Prefix key definitions can appear in either the global map or a
98 local map.  The definitions of `C-c', `C-x', `C-h', and <ESC> as prefix
99 keys appear in the global map, so these prefix keys are always
100 available.  Major modes can locally redefine a key as a prefix by
101 putting a prefix key definition for it in the local map.
102
103    A mode can also put a prefix definition of a global prefix character
104 such as `C-x' into its local map.  This is how major modes override the
105 definitions of certain keys that start with `C-x'.  This case is
106 special, because the local definition does not entirely replace the
107 global one.  When both the global and local definitions of a key are
108 other keymaps, the next character is looked up in both keymaps, with
109 the local definition overriding the global one.  The character after the
110 `C-x' is looked up in both the major mode's own keymap for redefined
111 `C-x' commands and in `ctl-x-map'.  If the major mode's own keymap for
112 `C-x' commands contains `nil', the definition from the global keymap
113 for `C-x' commands is used.
114
115 \1f
116 File: xemacs.info,  Node: Rebinding,  Next: Disabling,  Prev: Keymaps,  Up: Key Bindings
117
118 Changing Key Bindings
119 ---------------------
120
121    You can redefine an Emacs key by changing its entry in a keymap.
122 You can change the global keymap, in which case the change is effective
123 in all major modes except those that have their own overriding local
124 definitions for the same key.  Or you can change the current buffer's
125 local map, which affects all buffers using the same major mode.
126
127 * Menu:
128
129 * Interactive Rebinding::      Changing Key Bindings Interactively
130 * Programmatic Rebinding::     Changing Key Bindings Programmatically
131 * Key Bindings Using Strings:: Using Strings for Changing Key Bindings
132
133 \1f
134 File: xemacs.info,  Node: Interactive Rebinding,  Next: Programmatic Rebinding,  Up: Rebinding
135
136 Changing Key Bindings Interactively
137 ...................................
138
139 `M-x global-set-key <RET> KEY CMD <RET>'
140      Defines KEY globally to run CMD.
141
142 `M-x local-set-key <RET> KEYS CMD <RET>'
143      Defines KEY locally (in the major mode now in effect) to run CMD.
144
145 `M-x local-unset-key <RET> KEYS <RET>'
146      Removes the local binding of KEY.
147
148    CMD is a symbol naming an interactively-callable function.
149
150    When called interactively, KEY is the next complete key sequence
151 that you type.  When called as a function, KEY is a string, a vector of
152 events, or a vector of key-description lists as described in the
153 `define-key' function description.  The binding goes in the current
154 buffer's local map, which is shared with other buffers in the same
155 major mode.
156
157    The following example:
158
159      M-x global-set-key <RET> C-f next-line <RET>
160
161 redefines `C-f' to move down a line.  The fact that CMD is read second
162 makes it serve as a kind of confirmation for KEY.
163
164    These functions offer no way to specify a particular prefix keymap as
165 the one to redefine in, but that is not necessary, as you can include
166 prefixes in KEY.  KEY is read by reading characters one by one until
167 they amount to a complete key (that is, not a prefix key).  Thus, if
168 you type `C-f' for KEY, Emacs enters the minibuffer immediately to read
169 CMD.  But if you type `C-x', another character is read; if that
170 character is `4', another character is read, and so on.  For example,
171
172      M-x global-set-key <RET> C-x 4 $ spell-other-window <RET>
173
174 redefines `C-x 4 $' to run the (fictitious) command
175 `spell-other-window'.
176
177    The most general way to modify a keymap is the function
178 `define-key', used in Lisp code (such as your init file).  `define-key'
179 takes three arguments: the keymap, the key to modify in it, and the new
180 definition.  *Note Init File::, for an example.
181 `substitute-key-definition' is used similarly; it takes three
182 arguments, an old definition, a new definition, and a keymap, and
183 redefines in that keymap all keys that were previously defined with the
184 old definition to have the new definition instead.
185
186 \1f
187 File: xemacs.info,  Node: Programmatic Rebinding,  Next: Key Bindings Using Strings,  Prev: Interactive Rebinding,  Up: Rebinding
188
189 Changing Key Bindings Programmatically
190 ......................................
191
192    You can use the functions `global-set-key' and `define-key' to
193 rebind keys under program control.
194
195 ``(global-set-key KEYS CMD)''
196      Defines KEYS globally to run CMD.
197
198 ``(define-key KEYMAP KEYS DEF)''
199      Defines KEYS to run DEF in the keymap KEYMAP.
200
201    KEYMAP is a keymap object.
202
203    KEYS is the sequence of keystrokes to bind.
204
205    DEF is anything that can be a key's definition:
206
207    * `nil', meaning key is undefined in this keymap
208
209    * A command, that is, a Lisp function suitable for interactive
210      calling
211
212    * A string or key sequence vector, which is treated as a keyboard
213      macro
214
215    * A keymap to define a prefix key
216
217    * A symbol so that when the key is looked up, the symbol stands for
218      its function definition, which should at that time be one of the
219      above, or another symbol whose function definition is used, and so
220      on
221
222    * A cons, `(string . defn)', meaning that DEFN is the definition
223      (DEFN should be a valid definition in its own right)
224
225    * A cons, `(keymap . char)', meaning use the definition of CHAR in
226      map KEYMAP
227
228    For backward compatibility, XEmacs allows you to specify key
229 sequences as strings.  However, the preferred method is to use the
230 representations of key sequences as vectors of keystrokes.  *Note
231 Keystrokes::, for more information about the rules for constructing key
232 sequences.
233
234    Emacs allows you to abbreviate representations for key sequences in
235 most places where there is no ambiguity.  Here are some rules for
236 abbreviation:
237
238    * The keysym by itself is equivalent to a list of just that keysym,
239      i.e., `f1' is equivalent to `(f1)'.
240
241    * A keystroke by itself is equivalent to a vector containing just
242      that keystroke, i.e.,  `(control a)' is equivalent to `[(control
243      a)]'.
244
245    * You can use ASCII codes for keysyms that have them. i.e., `65' is
246      equivalent to `A'. (This is not so much an abbreviation as an
247      alternate representation.)
248
249    Here are some examples of programmatically binding keys:
250
251
252      ;;;  Bind `my-command' to <f1>
253      (global-set-key 'f1 'my-command)
254      
255      ;;;  Bind `my-command' to Shift-f1
256      (global-set-key '(shift f1) 'my-command)
257      
258      ;;; Bind `my-command' to C-c Shift-f1
259      (global-set-key '[(control c) (shift f1)] 'my-command)
260      
261      ;;; Bind `my-command' to the middle mouse button.
262      (global-set-key 'button2 'my-command)
263      
264      ;;; Bind `my-command' to <META> <CTL> <Right Mouse Button>
265      ;;; in the keymap that is in force when you are running `dired'.
266      (define-key dired-mode-map '(meta control button3) 'my-command)
267
268 \1f
269 File: xemacs.info,  Node: Key Bindings Using Strings,  Prev: Programmatic Rebinding,  Up: Rebinding
270
271 Using Strings for Changing Key Bindings
272 .......................................
273
274    For backward compatibility, you can still use strings to represent
275 key sequences.  Thus you can use commands like the following:
276
277      ;;; Bind `end-of-line' to C-f
278      (global-set-key "\C-f" 'end-of-line)
279
280    Note, however, that in some cases you may be binding more than one
281 key sequence by using a single command.  This situation can arise
282 because in ASCII, `C-i' and <TAB> have the same representation.
283 Therefore, when Emacs sees:
284
285      (global-set-key "\C-i" 'end-of-line)
286
287    it is unclear whether the user intended to bind `C-i' or <TAB>.  The
288 solution XEmacs adopts is to bind both of these key sequences.
289
290    After binding a command to two key sequences with a form like:
291
292              (define-key global-map "\^X\^I" 'command-1)
293
294    it is possible to redefine only one of those sequences like so:
295
296              (define-key global-map [(control x) (control i)] 'command-2)
297              (define-key global-map [(control x) tab] 'command-3)
298
299    This applies only when running under a window system.  If you are
300 talking to Emacs through an ASCII-only channel, you do not get any of
301 these features.
302
303    Here is a table of pairs of key sequences that behave in a similar
304 fashion:
305
306              control h      backspace
307              control l      clear
308              control i      tab
309              control m      return
310              control j      linefeed
311              control [      escape
312              control @      control space
313
314 \1f
315 File: xemacs.info,  Node: Disabling,  Prev: Rebinding,  Up: Key Bindings
316
317 Disabling Commands
318 ------------------
319
320    Disabling a command marks it as requiring confirmation before it can
321 be executed.  The purpose of disabling a command is to prevent
322 beginning users from executing it by accident and being confused.
323
324    The direct mechanism for disabling a command is to have a non-`nil'
325 `disabled' property on the Lisp symbol for the command.  These
326 properties are normally set by the user's init file with Lisp
327 expressions such as:
328
329      (put 'delete-region 'disabled t)
330
331    *Note Init File::.
332
333    If the value of the `disabled' property is a string, that string is
334 included in the message printed when the command is used:
335
336      (put 'delete-region 'disabled
337           "Text deleted this way cannot be yanked back!\n")
338
339    You can disable a command either by editing the init file directly
340 or with the command `M-x disable-command', which edits the init file
341 for you.  *Note Init File::.
342
343    When you attempt to invoke a disabled command interactively in Emacs,
344 a window is displayed containing the command's name, its documentation,
345 and some instructions on what to do next; then Emacs asks for input
346 saying whether to execute the command as requested, enable it and
347 execute, or cancel it.  If you decide to enable the command, you are
348 asked whether to do this permanently or just for the current session.
349 Enabling permanently works by automatically editing your init file.
350 You can use `M-x enable-command' at any time to enable any command
351 permanently.
352
353    Whether a command is disabled is independent of what key is used to
354 invoke it; it also applies if the command is invoked using `M-x'.
355 Disabling a command has no effect on calling it as a function from Lisp
356 programs.
357
358 \1f
359 File: xemacs.info,  Node: Syntax,  Next: Init File,  Prev: Key Bindings,  Up: Customization
360
361 The Syntax Table
362 ================
363
364    All the Emacs commands which parse words or balance parentheses are
365 controlled by the "syntax table".  The syntax table specifies which
366 characters are opening delimiters, which are parts of words, which are
367 string quotes, and so on.  Actually, each major mode has its own syntax
368 table (though sometimes related major modes use the same one) which it
369 installs in each buffer that uses that major mode.  The syntax table
370 installed in the current buffer is the one that all commands use, so we
371 call it "the" syntax table.  A syntax table is a Lisp object, a vector
372 of length 256 whose elements are numbers.
373
374 * Menu:
375
376 * Entry: Syntax Entry.    What the syntax table records for each character.
377 * Change: Syntax Change.  How to change the information.
378
379 \1f
380 File: xemacs.info,  Node: Syntax Entry,  Next: Syntax Change,  Up: Syntax
381
382 Information About Each Character
383 --------------------------------
384
385    The syntax table entry for a character is a number that encodes six
386 pieces of information:
387
388    * The syntactic class of the character, represented as a small
389      integer
390
391    * The matching delimiter, for delimiter characters only (the
392      matching delimiter of `(' is `)', and vice versa)
393
394    * A flag saying whether the character is the first character of a
395      two-character comment starting sequence
396
397    * A flag saying whether the character is the second character of a
398      two-character comment starting sequence
399
400    * A flag saying whether the character is the first character of a
401      two-character comment ending sequence
402
403    * A flag saying whether the character is the second character of a
404      two-character comment ending sequence
405
406    The syntactic classes are stored internally as small integers, but
407 are usually described to or by the user with characters.  For example,
408 `(' is used to specify the syntactic class of opening delimiters.  Here
409 is a table of syntactic classes, with the characters that specify them.
410
411 ` '
412      The class of whitespace characters.
413
414 `w'
415      The class of word-constituent characters.
416
417 `_'
418      The class of characters that are part of symbol names but not
419      words.  This class is represented by `_' because the character `_'
420      has this class in both C and Lisp.
421
422 `.'
423      The class of punctuation characters that do not fit into any other
424      special class.
425
426 `('
427      The class of opening delimiters.
428
429 `)'
430      The class of closing delimiters.
431
432 `''
433      The class of expression-adhering characters.  These characters are
434      part of a symbol if found within or adjacent to one, and are part
435      of a following expression if immediately preceding one, but are
436      like whitespace if surrounded by whitespace.
437
438 `"'
439      The class of string-quote characters.  They match each other in
440      pairs, and the characters within the pair all lose their syntactic
441      significance except for the `\' and `/' classes of escape
442      characters, which can be used to include a string-quote inside the
443      string.
444
445 `$'
446      The class of self-matching delimiters.  This is intended for TeX's
447      `$', which is used both to enter and leave math mode.  Thus, a
448      pair of matching `$' characters surround each piece of math mode
449      TeX input.  A pair of adjacent `$' characters act like a single
450      one for purposes of matching.
451
452 `/'
453      The class of escape characters that always just deny the following
454      character its special syntactic significance.  The character after
455      one of these escapes is always treated as alphabetic.
456
457 `\'
458      The class of C-style escape characters.  In practice, these are
459      treated just like `/'-class characters, because the extra
460      possibilities for C escapes (such as being followed by digits)
461      have no effect on where the containing expression ends.
462
463 `<'
464      The class of comment-starting characters.  Only single-character
465      comment starters (such as `;' in Lisp mode) are represented this
466      way.
467
468 `>'
469      The class of comment-ending characters.  Newline has this syntax in
470      Lisp mode.
471
472    The characters flagged as part of two-character comment delimiters
473 can have other syntactic functions most of the time.  For example, `/'
474 and `*' in C code, when found separately, have nothing to do with
475 comments.  The comment-delimiter significance overrides when the pair of
476 characters occur together in the proper order.  Only the list and sexp
477 commands use the syntax table to find comments; the commands
478 specifically for comments have other variables that tell them where to
479 find comments.  Moreover, the list and sexp commands notice comments
480 only if `parse-sexp-ignore-comments' is non-`nil'.  This variable is set
481 to `nil' in modes where comment-terminator sequences are liable to
482 appear where there is no comment, for example, in Lisp mode where the
483 comment terminator is a newline but not every newline ends a comment.
484
485 \1f
486 File: xemacs.info,  Node: Syntax Change,  Prev: Syntax Entry,  Up: Syntax
487
488 Altering Syntax Information
489 ---------------------------
490
491    It is possible to alter a character's syntax table entry by storing
492 a new number in the appropriate element of the syntax table, but it
493 would be hard to determine what number to use.  Emacs therefore
494 provides a command that allows you to specify the syntactic properties
495 of a character in a convenient way.
496
497    `M-x modify-syntax-entry' is the command to change a character's
498 syntax.  It can be used interactively and is also used by major modes
499 to initialize their own syntax tables.  Its first argument is the
500 character to change.  The second argument is a string that specifies the
501 new syntax.  When called from Lisp code, there is a third, optional
502 argument, which specifies the syntax table in which to make the change.
503 If not supplied, or if this command is called interactively, the third
504 argument defaults to the current buffer's syntax table.
505
506   1. The first character in the string specifies the syntactic class.
507      It is one of the characters in the previous table (*note Syntax
508      Entry::).
509
510   2. The second character is the matching delimiter.  For a character
511      that is not an opening or closing delimiter, this should be a
512      space, and may be omitted if no following characters are needed.
513
514   3. The remaining characters are flags.  The flag characters allowed
515      are:
516
517     `1'
518           Flag this character as the first of a two-character comment
519           starting sequence.
520
521     `2'
522           Flag this character as the second of a two-character comment
523           starting sequence.
524
525     `3'
526           Flag this character as the first of a two-character comment
527           ending sequence.
528
529     `4'
530           Flag this character as the second of a two-character comment
531           ending sequence.
532
533    Use `C-h s' (`describe-syntax') to display a description of the
534 contents of the current syntax table.  The description of each
535 character includes both the string you have to pass to
536 `modify-syntax-entry' to set up that character's current syntax, and
537 some English to explain that string if necessary.
538
539 \1f
540 File: xemacs.info,  Node: Init File,  Next: Audible Bell,  Prev: Syntax,  Up: Customization
541
542 The Init File
543 =============
544
545    When you start Emacs, it normally loads either `.xemacs/init.el' or
546 the file `.emacs' (whichever comes first) in your home directory.  This
547 file, if it exists, should contain Lisp code.  It is called your
548 initialization file or "init file".  Use the command line switch `-q'
549 to tell Emacs whether to load an init file (*note Entering Emacs::).
550 Use the command line switch `-user-init-file' (*note Command
551 Switches::) to tell Emacs to load a different file instead of
552 `~/.xemacs/init.el'/`~/.emacs'.
553
554    When the init file is read, the variable `user-init-file' says which
555 init file was loaded.
556
557    At some sites there is a "default init file", which is the library
558 named `default.el', found via the standard search path for libraries.
559 The Emacs distribution contains no such library; your site may create
560 one for local customizations.  If this library exists, it is loaded
561 whenever you start Emacs.  But your init file, if any, is loaded first;
562 if it sets `inhibit-default-init' non-`nil', then `default' is not
563 loaded.
564
565    If you have a large amount of code in your init file, you should
566 byte-compile it to `~/.xemacs/init.elc' or `~/.emacs.elc'.
567
568 * Menu:
569
570 * Init Syntax::     Syntax of constants in Emacs Lisp.
571 * Init Examples::   How to do some things with an init file.
572 * Terminal Init::   Each terminal type can have an init file.
573
574 \1f
575 File: xemacs.info,  Node: Init Syntax,  Next: Init Examples,  Up: Init File
576
577 Init File Syntax
578 ----------------
579
580    The init file contains one or more Lisp function call expressions.
581 Each consists of a function name followed by arguments, all surrounded
582 by parentheses.  For example, `(setq fill-column 60)' represents a call
583 to the function `setq' which is used to set the variable `fill-column'
584 (*note Filling::) to 60.
585
586    The second argument to `setq' is an expression for the new value of
587 the variable.  This can be a constant, a variable, or a function call
588 expression.  In the init file, constants are used most of the time.
589 They can be:
590
591 Numbers
592      Integers are written in decimal, with an optional initial minus
593      sign.
594
595      If a sequence of digits is followed by a period and another
596      sequence of digits, it is interpreted as a floating point number.
597
598      The number prefixes `#b', `#o', and `#x' are supported to
599      represent numbers in binary, octal, and hexadecimal notation (or
600      radix).
601
602 Strings
603      Lisp string syntax is the same as C string syntax with a few extra
604      features.  Use a double-quote character to begin and end a string
605      constant.
606
607      Newlines and special characters may be present literally in
608      strings.  They can also be represented as backslash sequences:
609      `\n' for newline, `\b' for backspace, `\r' for return, `\t' for
610      tab, `\f' for formfeed (control-l), `\e' for escape, `\\' for a
611      backslash, `\"' for a double-quote, or `\OOO' for the character
612      whose octal code is OOO.  Backslash and double-quote are the only
613      characters for which backslash sequences are mandatory.
614
615      You can use `\C-' as a prefix for a control character, as in
616      `\C-s' for ASCII Control-S, and `\M-' as a prefix for a Meta
617      character, as in `\M-a' for Meta-A or `\M-\C-a' for Control-Meta-A.
618
619 Characters
620      Lisp character constant syntax consists of a `?' followed by
621      either a character or an escape sequence starting with `\'.
622      Examples: `?x', `?\n', `?\"', `?\)'.  Note that strings and
623      characters are not interchangeable in Lisp; some contexts require
624      one and some contexts require the other.
625
626 True
627      `t' stands for `true'.
628
629 False
630      `nil' stands for `false'.
631
632 Other Lisp objects
633      Write a single-quote (') followed by the Lisp object you want.
634
635 \1f
636 File: xemacs.info,  Node: Init Examples,  Next: Terminal Init,  Prev: Init Syntax,  Up: Init File
637
638 Init File Examples
639 ------------------
640
641    Here are some examples of doing certain commonly desired things with
642 Lisp expressions:
643
644    * Make <TAB> in C mode just insert a tab if point is in the middle
645      of a line.
646
647           (setq c-tab-always-indent nil)
648
649      Here we have a variable whose value is normally `t' for `true' and
650      the alternative is `nil' for `false'.
651
652    * Make searches case sensitive by default (in all buffers that do not
653      override this).
654
655           (setq-default case-fold-search nil)
656
657      This sets the default value, which is effective in all buffers
658      that do not have local values for the variable.  Setting
659      `case-fold-search' with `setq' affects only the current buffer's
660      local value, which is probably not what you want to do in an init
661      file.
662
663    * Make Text mode the default mode for new buffers.
664
665           (setq default-major-mode 'text-mode)
666
667      Note that `text-mode' is used because it is the command for
668      entering the mode we want.  A single-quote is written before it to
669      make a symbol constant; otherwise, `text-mode' would be treated as
670      a variable name.
671
672    * Turn on Auto Fill mode automatically in Text mode and related
673      modes.
674
675           (setq text-mode-hook
676             '(lambda () (auto-fill-mode 1)))
677
678      Here we have a variable whose value should be a Lisp function.  The
679      function we supply is a list starting with `lambda', and a single
680      quote is written in front of it to make it (for the purpose of this
681      `setq') a list constant rather than an expression.  Lisp functions
682      are not explained here; for mode hooks it is enough to know that
683      `(auto-fill-mode 1)' is an expression that will be executed when
684      Text mode is entered.  You could replace it with any other
685      expression that you like, or with several expressions in a row.
686
687           (setq text-mode-hook 'turn-on-auto-fill)
688
689      This is another way to accomplish the same result.
690      `turn-on-auto-fill' is a symbol whose function definition is
691      `(lambda () (auto-fill-mode 1))'.
692
693    * Load the installed Lisp library named `foo' (actually a file
694      `foo.elc' or `foo.el' in a standard Emacs directory).
695
696           (load "foo")
697
698      When the argument to `load' is a relative pathname, not starting
699      with `/' or `~', `load' searches the directories in `load-path'
700      (*note Loading::).
701
702    * Load the compiled Lisp file `foo.elc' from your home directory.
703
704           (load "~/foo.elc")
705
706      Here an absolute file name is used, so no searching is done.
707
708    * Rebind the key `C-x l' to run the function `make-symbolic-link'.
709
710           (global-set-key "\C-xl" 'make-symbolic-link)
711
712      or
713
714           (define-key global-map "\C-xl" 'make-symbolic-link)
715
716      Note once again the single-quote used to refer to the symbol
717      `make-symbolic-link' instead of its value as a variable.
718
719    * Do the same thing for C mode only.
720
721           (define-key c-mode-map "\C-xl" 'make-symbolic-link)
722
723    * Bind the function key <F1> to a command in C mode.  Note that the
724      names of function keys must be lower case.
725
726           (define-key c-mode-map 'f1 'make-symbolic-link)
727
728    * Bind the shifted version of <F1> to a command.
729
730           (define-key c-mode-map '(shift f1) 'make-symbolic-link)
731
732    * Redefine all keys which now run `next-line' in Fundamental mode to
733      run `forward-line' instead.
734
735           (substitute-key-definition 'next-line 'forward-line
736                                      global-map)
737
738    * Make `C-x C-v' undefined.
739
740           (global-unset-key "\C-x\C-v")
741
742      One reason to undefine a key is so that you can make it a prefix.
743      Simply defining `C-x C-v ANYTHING' would make `C-x C-v' a prefix,
744      but `C-x C-v' must be freed of any non-prefix definition first.
745
746    * Make `$' have the syntax of punctuation in Text mode.  Note the
747      use of a character constant for `$'.
748
749           (modify-syntax-entry ?\$ "." text-mode-syntax-table)
750
751    * Enable the use of the command `eval-expression' without
752      confirmation.
753
754           (put 'eval-expression 'disabled nil)
755
756 \1f
757 File: xemacs.info,  Node: Terminal Init,  Prev: Init Examples,  Up: Init File
758
759 Terminal-Specific Initialization
760 --------------------------------
761
762    Each terminal type can have a Lisp library to be loaded into Emacs
763 when it is run on that type of terminal.  For a terminal type named
764 TERMTYPE, the library is called `term/TERMTYPE' and it is found by
765 searching the directories `load-path' as usual and trying the suffixes
766 `.elc' and `.el'.  Normally it appears in the subdirectory `term' of
767 the directory where most Emacs libraries are kept.
768
769    The usual purpose of the terminal-specific library is to define the
770 escape sequences used by the terminal's function keys using the library
771 `keypad.el'.  See the file `term/vt100.el' for an example of how this
772 is done.
773
774    When the terminal type contains a hyphen, only the part of the name
775 before the first hyphen is significant in choosing the library name.
776 Thus, terminal types `aaa-48' and `aaa-30-rv' both use the library
777 `term/aaa'.  The code in the library can use `(getenv "TERM")' to find
778 the full terminal type name.
779
780    The library's name is constructed by concatenating the value of the
781 variable `term-file-prefix' and the terminal type.  Your init file can
782 prevent the loading of the terminal-specific library by setting
783 `term-file-prefix' to `nil'.  *Note Init File::.
784
785    The value of the variable `term-setup-hook', if not `nil', is called
786 as a function of no arguments at the end of Emacs initialization, after
787 both your init file and any terminal-specific library have been read.
788 *Note Init File::.  You can set the value in the init file to override
789 part of any of the terminal-specific libraries and to define
790 initializations for terminals that do not have a library.
791
792 \1f
793 File: xemacs.info,  Node: Audible Bell,  Next: Faces,  Prev: Init File,  Up: Customization
794
795 Changing the Bell Sound
796 =======================
797
798    You can now change how the audible bell sounds using the variable
799 `sound-alist'.
800
801    `sound-alist''s value is an list associating symbols with, among
802 other things, strings of audio-data.  When `ding' is called with one of
803 the symbols, the associated sound data is played instead of the
804 standard beep.  This only works if you are logged in on the console of a
805 machine with audio hardware. To listen to a sound of the provided type,
806 call the function `play-sound' with the argument SOUND. You can also
807 set the volume of the sound with the optional argument VOLUME.
808
809    Each element of `sound-alist' is a list describing a sound.  The
810 first element of the list is the name of the sound being defined.
811 Subsequent elements of the list are alternating keyword/value pairs:
812
813 `sound'
814      A string of raw sound data, or the name of another sound to play.
815      The symbol `t' here means use the default X beep.
816
817 `volume'
818      An integer from 0-100, defaulting to `bell-volume'.
819
820 `pitch'
821      If using the default X beep, the pitch (Hz) to generate.
822
823 `duration'
824      If using the default X beep, the duration (milliseconds).
825
826    For compatibility, elements of `sound-alist' may also be of the form:
827
828      ( SOUND-NAME . <SOUND> )
829      ( SOUND-NAME <VOLUME> <SOUND> )
830
831    You should probably add things to this list by calling the function
832 `load-sound-file'.
833
834    Note that you can only play audio data if running on the console
835 screen of a machine with audio hardware which emacs understands, which
836 at this time means a Sun SparcStation, SGI, or HP9000s700.
837
838    Also note that the pitch, duration, and volume options are available
839 everywhere, but most X servers ignore the `pitch' option.
840
841    The variable `bell-volume' should be an integer from 0 to 100, with
842 100 being loudest, which controls how loud the sounds emacs makes
843 should be.  Elements of the `sound-alist' may override this value.
844 This variable applies to the standard X bell sound as well as sound
845 files.
846
847    If the symbol `t' is in place of a sound-string, Emacs uses the
848 default X beep.  This allows you to define beep-types of different
849 volumes even when not running on the console.
850
851    You can add things to this list by calling the function
852 `load-sound-file', which reads in an audio-file and adds its data to
853 the sound-alist. You can specify the sound with the SOUND-NAME argument
854 and the file into which the sounds are loaded with the FILENAME
855 argument. The optional VOLUME argument sets the volume.
856
857    `load-sound-file (FILENAME SOUND-NAME &optional VOLUME)'
858
859    To load and install some sound files as beep-types, use the function
860 `load-default-sounds' (note that this only works if you are on display
861 0 of a machine with audio hardware).
862
863    The following beep-types are used by Emacs itself. Other Lisp
864 packages may use other beep types, but these are the ones that the C
865 kernel of Emacs uses.
866
867 `auto-save-error'
868      An auto-save does not succeed
869
870 `command-error'
871      The Emacs command loop catches an error
872
873 `undefined-key'
874      You type a key that is undefined
875
876 `undefined-click'
877      You use an undefined mouse-click combination
878
879 `no-completion'
880      Completion was not possible
881
882 `y-or-n-p'
883      You type something other than the required `y' or `n'
884
885 `yes-or-no-p'
886      You type something other than `yes' or `no'
887
888 \1f
889 File: xemacs.info,  Node: Faces,  Next: Frame Components,  Prev: Audible Bell,  Up: Customization
890
891 Faces
892 =====
893
894    XEmacs has objects called extents and faces.  An "extent" is a
895 region of text and a "face" is a collection of textual attributes, such
896 as fonts and colors.  Every extent is displayed in some face;
897 therefore, changing the properties of a face immediately updates the
898 display of all associated extents.  Faces can be frame-local: you can
899 have a region of text that displays with completely different
900 attributes when its buffer is viewed from a different X window.
901
902    The display attributes of faces may be specified either in Lisp or
903 through the X resource manager.
904
905 Customizing Faces
906 -----------------
907
908    You can change the face of an extent with the functions in this
909 section.  All the functions prompt for a FACE as an argument; use
910 completion for a list of possible values.
911
912 `M-x invert-face'
913      Swap the foreground and background colors of the given FACE.
914
915 `M-x make-face-bold'
916      Make the font of the given FACE bold.  When called from a program,
917      returns `nil' if this is not possible.
918
919 `M-x make-face-bold-italic'
920      Make the font of the given FACE bold italic.  When called from a
921      program, returns `nil' if not possible.
922
923 `M-x make-face-italic'
924      Make the font of the given FACE italic.  When called from a
925      program, returns `nil' if not possible.
926
927 `M-x make-face-unbold'
928      Make the font of the given FACE non-bold.  When called from a
929      program, returns `nil' if not possible.
930
931 `M-x make-face-unitalic'
932      Make the font of the given FACE non-italic.  When called from a
933      program, returns `nil' if not possible.
934
935 `M-x make-face-larger'
936      Make the font of the given FACE a little larger.  When called from
937      a program, returns `nil' if not possible.
938
939 `M-x make-face-smaller'
940      Make the font of the given FACE a little smaller.  When called
941      from a program, returns `nil' if not possible.
942
943 `M-x set-face-background'
944      Change the background color of the given FACE.
945
946 `M-x set-face-background-pixmap'
947      Change the background pixmap of the given FACE.
948
949 `M-x set-face-font'
950      Change the font of the given FACE.
951
952 `M-x set-face-foreground'
953      Change the foreground color of the given FACE.
954
955 `M-x set-face-underline-p'
956      Change whether the given FACE is underlined.
957
958    You can exchange the foreground and background color of the selected
959 FACE with the function `invert-face'. If the face does not specify both
960 foreground and background, then its foreground and background are set
961 to the background and foreground of the default face.  When calling
962 this from a program, you can supply the optional argument FRAME to
963 specify which frame is affected; otherwise, all frames are affected.
964
965    You can set the background color of the specified FACE with the
966 function `set-face-background'.  The argument `color' should be a
967 string, the name of a color.  When called from a program, if the
968 optional FRAME argument is provided, the face is changed only in that
969 frame; otherwise, it is changed in all frames.
970
971    You can set the background pixmap of the specified FACE with the
972 function `set-face-background-pixmap'.  The pixmap argument NAME should
973 be a string, the name of a file of pixmap data.  The directories listed
974 in the `x-bitmap-file-path' variable are searched.  The bitmap may also
975 be a list of the form `(WIDTH HEIGHT DATA)', where WIDTH and HEIGHT are
976 the size in pixels, and DATA is a string containing the raw bits of the
977 bitmap.  If the optional FRAME argument is provided, the face is
978 changed only in that frame; otherwise, it is changed in all frames.
979
980    The variable `x-bitmap-file-path' takes as a value a list of the
981 directories in which X bitmap files may be found.  If the value is
982 `nil', the list is initialized from the `*bitmapFilePath' resource.
983
984    If the environment variable XBMLANGPATH is set, then it is consulted
985 before the `x-bitmap-file-path' variable.
986
987    You can set the font of the specified FACE with the function
988 `set-face-font'.  The FONT argument should be a string, the name of a
989 font.  When called from a program, if the optional FRAME argument is
990 provided, the face is changed only in that frame; otherwise, it is
991 changed in all frames.
992
993    You can set the foreground color of the specified FACE with the
994 function `set-face-foreground'.  The argument COLOR should be a string,
995 the name of a color.  If the optional FRAME argument is provided, the
996 face is changed only in that frame; otherwise, it is changed in all
997 frames.
998
999    You can set underline the specified FACE with the function
1000 `set-face-underline-p'. The argument UNDERLINE-P can be used to make
1001 underlining an attribute of the face or not. If the optional FRAME
1002 argument is provided, the face is changed only in that frame;
1003 otherwise, it is changed in all frames.
1004
1005 \1f
1006 File: xemacs.info,  Node: Frame Components,  Next: X Resources,  Prev: Faces,  Up: Customization
1007
1008 Frame Components
1009 ================
1010
1011    You can control the presence and position of most frame components,
1012 such as the menubar, toolbars, and gutters.
1013
1014    This section is not written yet.  Try the Lisp Reference Manual:
1015 *Note Menubar: (lispref)Menubar, *Note Toolbar Intro: (lispref)Toolbar
1016 Intro, and *Note Gutter Intro: (lispref)Gutter Intro.
1017
1018 \1f
1019 File: xemacs.info,  Node: X Resources,  Prev: Frame Components,  Up: Customization
1020
1021 X Resources
1022 ===========
1023
1024    Historically, XEmacs has used the X resource application class
1025 `Emacs' for its resources.  Unfortunately, GNU Emacs uses the same
1026 application class, and resources are not compatible between the two
1027 Emacsen.  This sharing of the application class often leads to trouble
1028 if you want to run both variants.
1029
1030    Starting with XEmacs 21, XEmacs uses the class `XEmacs' if it finds
1031 any XEmacs resources in the resource database when the X connection is
1032 initialized.  Otherwise, it will use the class `Emacs' for backwards
1033 compatibility.  The variable X-EMACS-APPLICATION-CLASS may be consulted
1034 to determine the application class being used.
1035
1036    The examples in this section assume the application class is `Emacs'.
1037
1038    The Emacs resources are generally set per-frame. Each Emacs frame
1039 can have its own name or the same name as another, depending on the
1040 name passed to the `make-frame' function.
1041
1042    You can specify resources for all frames with the syntax:
1043
1044      Emacs*parameter: value
1045
1046 or
1047
1048      Emacs*EmacsFrame.parameter:value
1049
1050 You can specify resources for a particular frame with the syntax:
1051
1052      Emacs*FRAME-NAME.parameter: value
1053
1054 * Menu:
1055
1056 * Geometry Resources::     Controlling the size and position of frames.
1057 * Iconic Resources::       Controlling whether frames come up iconic.
1058 * Resource List::          List of resources settable on a frame or device.
1059 * Face Resources::         Controlling faces using resources.
1060 * Widgets::                The widget hierarchy for XEmacs.
1061 * Menubar Resources::      Specifying resources for the menubar.
1062
1063 \1f
1064 File: xemacs.info,  Node: Geometry Resources,  Next: Iconic Resources,  Up: X Resources
1065
1066 Geometry Resources
1067 ------------------
1068
1069    To make the default size of all Emacs frames be 80 columns by 55
1070 lines, do this:
1071
1072      Emacs*EmacsFrame.geometry: 80x55
1073
1074 To set the geometry of a particular frame named `fred', do this:
1075
1076      Emacs*fred.geometry: 80x55
1077
1078 Important! Do not use the following syntax:
1079
1080      Emacs*geometry: 80x55
1081
1082 You should never use `*geometry' with any X application. It does not
1083 say "make the geometry of Emacs be 80 columns by 55 lines."  It really
1084 says, "make Emacs and all subwindows thereof be 80x55 in whatever units
1085 they care to measure in."  In particular, that is both telling the
1086 Emacs text pane to be 80x55 in characters, and telling the menubar pane
1087 to be 80x55 pixels, which is surely not what you want.
1088
1089    As a special case, this geometry specification also works (and sets
1090 the default size of all Emacs frames to 80 columns by 55 lines):
1091
1092      Emacs.geometry: 80x55
1093
1094 since that is the syntax used with most other applications (since most
1095 other applications have only one top-level window, unlike Emacs).  In
1096 general, however, the top-level shell (the unmapped ApplicationShell
1097 widget named `Emacs' that is the parent of the shell widgets that
1098 actually manage the individual frames) does not have any interesting
1099 resources on it, and you should set the resources on the frames instead.
1100
1101    The `-geometry' command-line argument sets only the geometry of the
1102 initial frame created by Emacs.
1103
1104    A more complete explanation of geometry-handling is
1105
1106    * The `-geometry' command-line option sets the `Emacs.geometry'
1107      resource, that is, the geometry of the ApplicationShell.
1108
1109    * For the first frame created, the size of the frame is taken from
1110      the ApplicationShell if it is specified, otherwise from the
1111      geometry of the frame.
1112
1113    * For subsequent frames, the order is reversed: First the frame, and
1114      then the ApplicationShell.
1115
1116    * For the first frame created, the position of the frame is taken
1117      from the ApplicationShell (`Emacs.geometry') if it is specified,
1118      otherwise from the geometry of the frame.
1119
1120    * For subsequent frames, the position is taken only from the frame,
1121      and never from the ApplicationShell.
1122
1123    This is rather complicated, but it does seem to provide the most
1124 intuitive behavior with respect to the default sizes and positions of
1125 frames created in various ways.
1126
1127 \1f
1128 File: xemacs.info,  Node: Iconic Resources,  Next: Resource List,  Prev: Geometry Resources,  Up: X Resources
1129
1130 Iconic Resources
1131 ----------------
1132
1133    Analogous to `-geometry', the `-iconic' command-line option sets the
1134 iconic flag of the ApplicationShell (`Emacs.iconic') and always applies
1135 to the first frame created regardless of its name.  However, it is
1136 possible to set the iconic flag on particular frames (by name) by using
1137 the `Emacs*FRAME-NAME.iconic' resource.
1138
1139 \1f
1140 File: xemacs.info,  Node: Resource List,  Next: Face Resources,  Prev: Iconic Resources,  Up: X Resources
1141
1142 Resource List
1143 -------------
1144
1145    Emacs frames accept the following resources:
1146
1147 `geometry' (class `Geometry'): string
1148      Initial geometry for the frame.  *Note Geometry Resources::, for a
1149      complete discussion of how this works.
1150
1151 `iconic' (class `Iconic'): boolean
1152      Whether this frame should appear in the iconified state.
1153
1154 `internalBorderWidth' (class `InternalBorderWidth'): int
1155      How many blank pixels to leave between the text and the edge of the
1156      window.
1157
1158 `interline' (class `Interline'): int
1159      How many pixels to leave between each line (may not be
1160      implemented).
1161
1162 `menubar' (class `Menubar'): boolean
1163      Whether newly-created frames should initially have a menubar.  Set
1164      to true by default.
1165
1166 `initiallyUnmapped' (class `InitiallyUnmapped'): boolean
1167      Whether XEmacs should leave the initial frame unmapped when it
1168      starts up.  This is useful if you are starting XEmacs as a server
1169      (e.g. in conjunction with gnuserv or the external client widget).
1170      You can also control this with the `-unmapped' command-line option.
1171
1172 `barCursor' (class `BarColor'): boolean
1173      Whether the cursor should be displayed as a bar, or the
1174      traditional box.
1175
1176 `cursorColor' (class `CursorColor'): color-name
1177      The color of the text cursor.
1178
1179 `scrollBarWidth' (class `ScrollBarWidth'): integer
1180      How wide the vertical scrollbars should be, in pixels; 0 means no
1181      vertical scrollbars.  You can also use a resource specification of
1182      the form `*scrollbar.width', or the usual toolkit scrollbar
1183      resources: `*XmScrollBar.width' (Motif), `*XlwScrollBar.width'
1184      (Lucid), or `*Scrollbar.thickness' (Athena).  We don't recommend
1185      that you use the toolkit resources, though, because they're
1186      dependent on how exactly your particular build of XEmacs was
1187      configured.
1188
1189 `scrollBarHeight' (class `ScrollBarHeight'): integer
1190      How high the horizontal scrollbars should be, in pixels; 0 means no
1191      horizontal scrollbars.  You can also use a resource specification
1192      of the form `*scrollbar.height', or the usual toolkit scrollbar
1193      resources: `*XmScrollBar.height' (Motif), `*XlwScrollBar.height'
1194      (Lucid), or `*Scrollbar.thickness' (Athena).  We don't recommend
1195      that you use the toolkit resources, though, because they're
1196      dependent on how exactly your particular build of XEmacs was
1197      configured.
1198
1199 `scrollBarPlacement' (class `ScrollBarPlacement'): string
1200      Where the horizontal and vertical scrollbars should be positioned.
1201      This should be one of the four strings `BOTTOM_LEFT',
1202      `BOTTOM_RIGHT', `TOP_LEFT', and `TOP_RIGHT'.  Default is
1203      `BOTTOM_RIGHT' for the Motif and Lucid scrollbars and
1204      `BOTTOM_LEFT' for the Athena scrollbars.
1205
1206 `topToolBarHeight' (class `TopToolBarHeight'): integer
1207 `bottomToolBarHeight' (class `BottomToolBarHeight'): integer
1208 `leftToolBarWidth' (class `LeftToolBarWidth'): integer
1209 `rightToolBarWidth' (class `RightToolBarWidth'): integer
1210      Height and width of the four possible toolbars.
1211
1212 `topToolBarShadowColor' (class `TopToolBarShadowColor'): color-name
1213 `bottomToolBarShadowColor' (class `BottomToolBarShadowColor'): color-name
1214      Color of the top and bottom shadows for the toolbars.  NOTE: These
1215      resources do _not_ have anything to do with the top and bottom
1216      toolbars (i.e. the toolbars at the top and bottom of the frame)!
1217      Rather, they affect the top and bottom shadows around the edges of
1218      all four kinds of toolbars.
1219
1220 `topToolBarShadowPixmap' (class `TopToolBarShadowPixmap'): pixmap-name
1221 `bottomToolBarShadowPixmap' (class `BottomToolBarShadowPixmap'): pixmap-name
1222      Pixmap of the top and bottom shadows for the toolbars.  If set,
1223      these resources override the corresponding color resources. NOTE:
1224      These resources do _not_ have anything to do with the top and
1225      bottom toolbars (i.e. the toolbars at the top and bottom of the
1226      frame)!  Rather, they affect the top and bottom shadows around the
1227      edges of all four kinds of toolbars.
1228
1229 `toolBarShadowThickness' (class `ToolBarShadowThickness'): integer
1230      Thickness of the shadows around the toolbars, in pixels.
1231
1232 `visualBell' (class `VisualBell'): boolean
1233      Whether XEmacs should flash the screen rather than making an
1234      audible beep.
1235
1236 `bellVolume' (class `BellVolume'): integer
1237      Volume of the audible beep.
1238
1239 `useBackingStore' (class `UseBackingStore'): boolean
1240      Whether XEmacs should set the backing-store attribute of the X
1241      windows it creates.  This increases the memory usage of the X
1242      server but decreases the amount of X traffic necessary to update
1243      the screen, and is useful when the connection to the X server goes
1244      over a low-bandwidth line such as a modem connection.
1245
1246    Emacs devices accept the following resources:
1247
1248 `textPointer' (class `Cursor'): cursor-name
1249      The cursor to use when the mouse is over text.  This resource is
1250      used to initialize the variable `x-pointer-shape'.
1251
1252 `selectionPointer' (class `Cursor'): cursor-name
1253      The cursor to use when the mouse is over a selectable text region
1254      (an extent with the `highlight' property; for example, an Info
1255      cross-reference).  This resource is used to initialize the variable
1256      `x-selection-pointer-shape'.
1257
1258 `spacePointer' (class `Cursor'): cursor-name
1259      The cursor to use when the mouse is over a blank space in a buffer
1260      (that is, after the end of a line or after the end-of-file).  This
1261      resource is used to initialize the variable
1262      `x-nontext-pointer-shape'.
1263
1264 `modeLinePointer' (class `Cursor'): cursor-name
1265      The cursor to use when the mouse is over a modeline.  This
1266      resource is used to initialize the variable `x-mode-pointer-shape'.
1267
1268 `gcPointer' (class `Cursor'): cursor-name
1269      The cursor to display when a garbage-collection is in progress.
1270      This resource is used to initialize the variable
1271      `x-gc-pointer-shape'.
1272
1273 `scrollbarPointer' (class `Cursor'): cursor-name
1274      The cursor to use when the mouse is over the scrollbar.  This
1275      resource is used to initialize the variable
1276      `x-scrollbar-pointer-shape'.
1277
1278 `pointerColor' (class `Foreground'): color-name
1279 `pointerBackground' (class `Background'): color-name
1280      The foreground and background colors of the mouse cursor.  These
1281      resources are used to initialize the variables
1282      `x-pointer-foreground-color' and `x-pointer-background-color'.
1283