annotate man/xemacs/custom.texi @ 1633:baca156a450b

[xemacs-hg @ 2003-08-19 02:11:46 by james] Make modules build and run on Cygwin and MinGW. This is the second commit to get the toplevel files that were not committed the first time.
author james
date Tue, 19 Aug 2003 02:11:49 +0000
parents 55834f418dfb
children f43f9ca6c7d9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 @node Customization, Quitting, Emulation, Top
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3 @chapter Customization
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4 @cindex customization
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 This chapter talks about various topics relevant to adapting the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 behavior of Emacs in minor ways.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 All kinds of customization affect only the particular Emacs job that you
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
10 do them in. They are completely lost when you kill the Emacs job, and
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
11 have no effect on other Emacs jobs you may run at the same time or
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
12 later. The only way an Emacs job can affect anything outside of it is
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
13 by writing a file; in particular, the only way to make a customization
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
14 `permanent' is to put something in your init file or other appropriate
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
15 file to do the customization in each session. @xref{Init File}.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 @menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 * Minor Modes:: Each minor mode is one feature you can turn on
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 independently of any others.
775
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
20 * Behaviors:: Like minor modes, behaviors are independent of other
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
21 features, but behaviors are usually enabled globally,
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
22 while minor modes are per-buffer and often temporary.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 * Variables:: Many Emacs commands examine Emacs variables
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 to decide what to do; by setting variables,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25 you can control their functioning.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26 * Keyboard Macros:: A keyboard macro records a sequence of keystrokes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27 to be replayed with a single command.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28 * Key Bindings:: The keymaps say what command each key runs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29 By changing them, you can "redefine keys".
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30 * Syntax:: The syntax table controls how words and expressions
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 are parsed.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
32 * Init File:: How to write common customizations in the init file.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
33 * Audible Bell:: Changing how Emacs sounds the bell.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
34 * Faces:: Changing the fonts and colors of a region of text.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
35 * Frame Components:: Controlling the presence and positions of the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
36 menubar, toolbars, and gutters.
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
37 * X Resources:: X resources controlling various aspects of the
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 behavior of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39 @end menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 @node Minor Modes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 @section Minor Modes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 @cindex minor modes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 @cindex mode line
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 Minor modes are options which you can use or not. For example, Auto
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 Fill mode is a minor mode in which @key{SPC} breaks lines between words
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 as you type. All the minor modes are independent of each other and of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 the selected major mode. Most minor modes inform you in the mode line
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 when they are on; for example, @samp{Fill} in the mode line means that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51 Auto Fill mode is on.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53 Append @code{-mode} to the name of a minor mode to get the name of a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
54 command function that turns the mode on or off. Thus, the command to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55 enable or disable Auto Fill mode is called @kbd{M-x auto-fill-mode}. These
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56 commands are usually invoked with @kbd{M-x}, but you can bind keys to them
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57 if you wish. With no argument, the function turns the mode on if it was
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 off and off if it was on. This is known as @dfn{toggling}. A positive
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 argument always turns the mode on, and an explicit zero argument or a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 negative argument always turns it off.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62 @cindex Auto Fill mode
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63 @findex auto-fill-mode
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 Auto Fill mode allows you to enter filled text without breaking lines
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 explicitly. Emacs inserts newlines as necessary to prevent lines from
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 becoming too long. @xref{Filling}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68 @cindex Overwrite mode
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69 @findex overwrite-mode
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70 Overwrite mode causes ordinary printing characters to replace existing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 text instead of moving it to the right. For example, if point is in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72 front of the @samp{B} in @samp{FOOBAR}, and you type a @kbd{G} in Overwrite
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73 mode, it changes to @samp{FOOGAR}, instead of @samp{FOOGBAR}.@refill
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 @cindex Abbrev mode
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76 @findex abbrev-mode
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 Abbrev mode allows you to define abbreviations that automatically expand
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78 as you type them. For example, @samp{amd} might expand to @samp{abbrev
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 mode}. @xref{Abbrevs}, for full information.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80
775
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
81 @c Updated for 21.5.6 2002/03/13 sjt
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
82 @node Behaviors
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
83 @section Behaviors
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
84 @cindex behavior
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
85
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
86 Some functionality requires a fair amount of effort to enable globally
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
87 in a session. For example, someone who discovers filladapt and really
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
88 likes it must toggle it separately in each buffer. On the other hand,
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
89 after trying it for a while she might like to disable it everywhere,
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
90 having decided it doesn't work very well for her. Such a functionality
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
91 is called a @dfn{behavior}.
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
92
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
93 The package developer will register behaviors with XEmacs. Then the
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
94 user invokes the @code{enable-behavior} and @code{disable-behavior}
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
95 functions to enable or disable a given behavior. The behavior registry
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
96 was introduced in XEmacs 21.5.6.
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
97
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
98 @defun enable-behavior behavior [force]
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
99 Called interactively, prompt the user, read a behavior symbol name with
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
100 completion for @var{behavior}, and take @var{force} from the prefix
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
101 argument. Then enable the behavior registered under the symbol
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
102 @var{behavior}.
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
103
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
104 The optional argument @var{force} is unimplemented in 21.5.6.
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
105 @end defun
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
106
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
107 @defun disable-behavior behavior [force]
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
108 Called interactively, prompt the user, read a behavior symbol name with
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
109 completion for @var{behavior}, and take @var{force} from the prefix
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
110 argument. Then disable the behavior registered under the symbol
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
111 @var{behavior}.
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
112
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
113 The optional argument @var{force} is unimplemented in 21.5.6.
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
114 @end defun
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
115
7d972c3de90a [xemacs-hg @ 2002-03-14 11:50:12 by stephent]
stephent
parents: 602
diff changeset
116
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117 @node Variables
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118 @section Variables
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119 @cindex variable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120 @cindex option
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
122 A @dfn{variable} is a Lisp symbol which has a value. Variable names
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 can contain any characters, but by convention they are words separated
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 by hyphens. A variable can also have a documentation string, which
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125 describes what kind of value it should have and how the value will be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126 used.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128 Lisp allows any variable to have any kind of value, but most variables
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129 that Emacs uses require a value of a certain type. Often the value has
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
130 to be a string or a number. Sometimes we say that a certain feature is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
131 turned on if a variable is ``non-@code{nil},'' meaning that if the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
132 variable's value is @code{nil}, the feature is off, but the feature is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133 on for @i{any} other value. The conventional value to turn on the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134 feature---since you have to pick one particular value when you set the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
135 variable---is @code{t}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
136
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
137 Emacs uses many Lisp variables for internal recordkeeping, as any Lisp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
138 program must, but the most interesting variables for you are the ones that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139 exist for the sake of customization. Emacs does not (usually) change the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
140 values of these variables; instead, you set the values, and thereby alter
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
141 and control the behavior of certain Emacs commands. These variables are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
142 called @dfn{options}. Most options are documented in this manual and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
143 appear in the Variable Index (@pxref{Variable Index}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
144
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
145 One example of a variable which is an option is @code{fill-column}, which
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
146 specifies the position of the right margin (as a number of characters from
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
147 the left margin) to be used by the fill commands (@pxref{Filling}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
148
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
149 @menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
150 * Examining:: Examining or setting one variable's value.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
151 * Easy Customization:: Convenient and easy customization of variables.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
152 * Edit Options:: Examining or editing list of all variables' values.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
153 * Locals:: Per-buffer values of variables.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
154 * File Variables:: How files can specify variable values.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
155 @end menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
156
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
157 @node Examining
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
158 @subsection Examining and Setting Variables
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
159 @cindex setting variables
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
160
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
161 @table @kbd
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
162 @item C-h v
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
163 @itemx M-x describe-variable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
164 Print the value and documentation of a variable.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
165 @findex set-variable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
166 @item M-x set-variable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
167 Change the value of a variable.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
168 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
169
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
170 @kindex C-h v
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
171 @findex describe-variable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
172 To examine the value of a single variable, use @kbd{C-h v}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
173 (@code{describe-variable}), which reads a variable name using the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
174 minibuffer, with completion. It prints both the value and the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
175 documentation of the variable.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
176
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
177 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
178 C-h v fill-column @key{RET}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
179 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
180
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
181 @noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
182 prints something like:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
183
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
184 @smallexample
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
185 fill-column's value is 75
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
186
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
187 Documentation:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
188 *Column beyond which automatic line-wrapping should happen.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
189 Automatically becomes local when set in any fashion.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
190 @end smallexample
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
191
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
192 @cindex option
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
193 @noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
194 The star at the beginning of the documentation indicates that this variable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195 is an option. @kbd{C-h v} is not restricted to options; it allows any
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
196 variable name.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
197
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
198 @findex set-variable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
199 If you know which option you want to set, you can use @kbd{M-x
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
200 set-variable} to set it. This prompts for the variable name in the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
201 minibuffer (with completion), and then prompts for a Lisp expression for the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
202 new value using the minibuffer a second time. For example,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
203
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
204 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
205 M-x set-variable @key{RET} fill-column @key{RET} 75 @key{RET}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
206 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
207
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
208 @noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
209 sets @code{fill-column} to 75, as if you had executed the Lisp expression
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
210 @code{(setq fill-column 75)}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
211
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
212 Setting variables in this way, like all means of customizing Emacs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
213 except where explicitly stated, affects only the current Emacs session.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
214
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
215 @node Easy Customization
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
216 @subsection Easy Customization Interface
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
217
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
218 @findex customize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
219 @cindex customization buffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
220 A convenient way to find the user option variables that you want to
600
a99eebfee7d3 [xemacs-hg @ 2001-06-01 07:15:24 by martinb]
martinb
parents: 442
diff changeset
221 change, and then change them, is with @kbd{C-h C} (@code{customize}).
a99eebfee7d3 [xemacs-hg @ 2001-06-01 07:15:24 by martinb]
martinb
parents: 442
diff changeset
222 This command creates a @dfn{customization buffer} with which you can
a99eebfee7d3 [xemacs-hg @ 2001-06-01 07:15:24 by martinb]
martinb
parents: 442
diff changeset
223 browse through the Emacs user options in a logically organized
a99eebfee7d3 [xemacs-hg @ 2001-06-01 07:15:24 by martinb]
martinb
parents: 442
diff changeset
224 structure, then edit and set their values. You can also use the
a99eebfee7d3 [xemacs-hg @ 2001-06-01 07:15:24 by martinb]
martinb
parents: 442
diff changeset
225 customization buffer to save settings permanently. (Not all Emacs user
a99eebfee7d3 [xemacs-hg @ 2001-06-01 07:15:24 by martinb]
martinb
parents: 442
diff changeset
226 options are included in this structure as of yet, but we are adding the
a99eebfee7d3 [xemacs-hg @ 2001-06-01 07:15:24 by martinb]
martinb
parents: 442
diff changeset
227 rest.)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
228
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
229 @menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
230 * Groups: Customization Groups.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
231 How options are classified in a structure.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
232 * Changing an Option:: How to edit a value and set an option.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
233 * Face Customization:: How to edit the attributes of a face.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
234 * Specific Customization:: Making a customization buffer for specific
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
235 options, faces, or groups.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
236 @end menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
237
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
238 @node Customization Groups
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
239 @subsubsection Customization Groups
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
240 @cindex customization groups
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
241
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
242 For customization purposes, user options are organized into
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
243 @dfn{groups} to help you find them. Groups are collected into bigger
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
244 groups, all the way up to a master group called @code{Emacs}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
245
602
b9f1a2e84ead [xemacs-hg @ 2001-06-01 08:17:05 by martinb]
martinb
parents: 600
diff changeset
246 @kbd{C-h C} (@code{customize}) creates a customization buffer that
600
a99eebfee7d3 [xemacs-hg @ 2001-06-01 07:15:24 by martinb]
martinb
parents: 442
diff changeset
247 shows the top-level @code{Emacs} group and the second-level groups
a99eebfee7d3 [xemacs-hg @ 2001-06-01 07:15:24 by martinb]
martinb
parents: 442
diff changeset
248 immediately under it. It looks like this, in part:
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
249
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
250 @smallexample
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
251 /- Emacs group: ---------------------------------------------------\
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
252 [State]: visible group members are all at standard settings.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
253 Customization of the One True Editor.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
254 See also [Manual].
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
255
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
256 [Open] Editing group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
257 Basic text editing facilities.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
258
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
259 [Open] External group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
260 Interfacing to external utilities.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
261
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
262 @var{more second-level groups}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
263
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
264 \- Emacs group end ------------------------------------------------/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
265
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
266 @end smallexample
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
267
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
268 @noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
269 This says that the buffer displays the contents of the @code{Emacs}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
270 group. The other groups are listed because they are its contents. But
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
271 they are listed differently, without indentation and dashes, because
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
272 @emph{their} contents are not included. Each group has a single-line
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
273 documentation string; the @code{Emacs} group also has a @samp{[State]}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
274 line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
275
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
276 @cindex editable fields (customization buffer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
277 @cindex active fields (customization buffer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
278 Most of the text in the customization buffer is read-only, but it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
279 typically includes some @dfn{editable fields} that you can edit. There
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
280 are also @dfn{active fields}; this means a field that does something
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
281 when you @dfn{invoke} it. To invoke an active field, either click on it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
282 with @kbd{Mouse-1}, or move point to it and type @key{RET}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
283
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
284 For example, the phrase @samp{[Open]} that appears in a second-level
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
285 group is an active field. Invoking the @samp{[Open]} field for a group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
286 opens up a new customization buffer, which shows that group and its
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
287 contents. This field is a kind of hypertext link to another group.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
288
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
289 The @code{Emacs} group does not include any user options itself, but
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
290 other groups do. By examining various groups, you will eventually find
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
291 the options and faces that belong to the feature you are interested in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
292 customizing. Then you can use the customization buffer to set them.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
293
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
294 @findex customize-browse
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
295 You can view the structure of customization groups on a larger scale
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
296 with @kbd{M-x customize-browse}. This command creates a special kind of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
297 customization buffer which shows only the names of the groups (and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
298 options and faces), and their structure.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
299
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
300 In this buffer, you can show the contents of a group by invoking
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
301 @samp{[+]}. When the group contents are visible, this button changes to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
302 @samp{[-]}; invoking that hides the group contents.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
303
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
304 Each group, option or face name in this buffer has an active field
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
305 which says @samp{[Group]}, @samp{[Option]} or @samp{[Face]}. Invoking
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
306 that active field creates an ordinary customization buffer showing just
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
307 that group and its contents, just that option, or just that face.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
308 This is the way to set values in it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
309
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
310 @node Changing an Option
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
311 @subsubsection Changing an Option
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
312
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
313 Here is an example of what a user option looks like in the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
314 customization buffer:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
315
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
316 @smallexample
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
317 Kill Ring Max: [Hide] 30
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
318 [State]: this option is unchanged from its standard setting.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
319 Maximum length of kill ring before oldest elements are thrown away.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
320 @end smallexample
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
321
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
322 The text following @samp{[Hide]}, @samp{30} in this case, indicates
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
323 the current value of the option. If you see @samp{[Show]} instead of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
324 @samp{[Hide]}, it means that the value is hidden; the customization
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
325 buffer initially hides values that take up several lines. Invoke
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
326 @samp{[Show]} to show the value.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
327
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
328 The line after the option name indicates the @dfn{customization state}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
329 of the option: in the example above, it says you have not changed the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
330 option yet. The word @samp{[State]} at the beginning of this line is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
331 active; you can get a menu of various operations by invoking it with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
332 @kbd{Mouse-1} or @key{RET}. These operations are essential for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
333 customizing the variable.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
334
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
335 The line after the @samp{[State]} line displays the beginning of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
336 option's documentation string. If there are more lines of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
337 documentation, this line ends with @samp{[More]}; invoke this to show
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
338 the full documentation string.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
339
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
340 To enter a new value for @samp{Kill Ring Max}, move point to the value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
341 and edit it textually. For example, you can type @kbd{M-d}, then insert
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
342 another number.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
343
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
344 When you begin to alter the text, you will see the @samp{[State]} line
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
345 change to say that you have edited the value:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
346
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
347 @smallexample
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
348 [State]: you have edited the value as text, but not set the option.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
349 @end smallexample
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
350
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
351 @cindex setting option value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
352 Editing the value does not actually set the option variable. To do
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
353 that, you must @dfn{set} the option. To do this, invoke the word
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
354 @samp{[State]} and choose @samp{Set for Current Session}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
355
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
356 The state of the option changes visibly when you set it:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
357
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
358 @smallexample
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
359 [State]: you have set this option, but not saved it for future sessions.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
360 @end smallexample
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
361
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
362 You don't have to worry about specifying a value that is not valid;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
363 setting the option checks for validity and will not really install an
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
364 unacceptable value.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
365
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
366 @kindex M-TAB @r{(customization buffer)}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
367 @findex widget-complete
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
368 While editing a value or field that is a file name, directory name,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
369 command name, or anything else for which completion is defined, you can
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
370 type @kbd{M-@key{TAB}} (@code{widget-complete}) to do completion.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
371
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
372 Some options have a small fixed set of possible legitimate values.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
373 These options don't let you edit the value textually. Instead, an
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
374 active field @samp{[Value Menu]} appears before the value; invoke this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
375 field to edit the value. For a boolean ``on or off'' value, the active
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
376 field says @samp{[Toggle]}, and it changes to the other value.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
377 @samp{[Value Menu]} and @samp{[Toggle]} edit the buffer; the changes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
378 take effect when you use the @samp{Set for Current Session} operation.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
379
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
380 Some options have values with complex structure. For example, the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
381 value of @code{load-path} is a list of directories. Here is how it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
382 appears in the customization buffer:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
383
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
384 @smallexample
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
385 Load Path:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
386 [INS] [DEL] [Current dir?]: /usr/local/share/emacs/19.34.94/site-lisp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
387 [INS] [DEL] [Current dir?]: /usr/local/share/emacs/site-lisp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
388 [INS] [DEL] [Current dir?]: /usr/local/share/emacs/19.34.94/leim
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
389 [INS] [DEL] [Current dir?]: /usr/local/share/emacs/19.34.94/lisp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
390 [INS] [DEL] [Current dir?]: /build/emacs/e19/lisp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
391 [INS] [DEL] [Current dir?]: /build/emacs/e19/lisp/gnus
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
392 [INS]
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
393 [State]: this item has been changed outside the customization buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
394 List of directories to search for files to load....
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
395 @end smallexample
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
396
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
397 @noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
398 Each directory in the list appears on a separate line, and each line has
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
399 several editable or active fields.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
400
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
401 You can edit any of the directory names. To delete a directory from
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
402 the list, invoke @samp{[DEL]} on that line. To insert a new directory in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
403 the list, invoke @samp{[INS]} at the point where you want to insert it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
404
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
405 You can also invoke @samp{[Current dir?]} to switch between including
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
406 a specific named directory in the path, and including @code{nil} in the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
407 path. (@code{nil} in a search path means ``try the current
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
408 directory.'')
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
409
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
410 @kindex TAB @r{(customization buffer)}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
411 @kindex S-TAB @r{(customization buffer)}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
412 @findex widget-forward
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
413 @findex widget-backward
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
414 Two special commands, @key{TAB} and @kbd{S-@key{TAB}}, are useful for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
415 moving through the customization buffer. @key{TAB}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
416 (@code{widget-forward}) moves forward to the next active or editable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
417 field; @kbd{S-@key{TAB}} (@code{widget-backward}) moves backward to the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
418 previous active or editable field.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
419
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
420 Typing @key{RET} on an editable field also moves forward, just like
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
421 @key{TAB}. The reason for this is that people have a tendency to type
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
422 @key{RET} when they are finished editing a field. If you have occasion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
423 to insert a newline in an editable field, use @kbd{C-o} or @kbd{C-q
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
424 C-j},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
425
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
426 @cindex saving option value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
427 Setting the option changes its value in the current Emacs session;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
428 @dfn{saving} the value changes it for future sessions as well. This
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
429 works by writing code into your init file so as to set the option
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
430 variable again each time you start Emacs. @xref{Init File}. To save
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
431 the option, invoke @samp{[State]} and select the @samp{Save for Future
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
432 Sessions} operation.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
433
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
434 You can also restore the option to its standard value by invoking
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
435 @samp{[State]} and selecting the @samp{Reset} operation. There are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
436 actually three reset operations:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
437
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
438 @table @samp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
439 @item Reset to Current
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
440 If you have made some modifications and not yet set the option,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
441 this restores the text in the customization buffer to match
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
442 the actual value.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
443
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
444 @item Reset to Saved
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
445 This restores the value of the option to the last saved value,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
446 and updates the text accordingly.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
447
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
448 @item Reset to Standard Settings
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
449 This sets the option to its standard value, and updates the text
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
450 accordingly. This also eliminates any saved value for the option,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
451 so that you will get the standard value in future Emacs sessions.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
452 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
453
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
454 The state of a group indicates whether anything in that group has been
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
455 edited, set or saved. You can select @samp{Set for Current Session},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
456 @samp{Save for Future Sessions} and the various kinds of @samp{Reset}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
457 operation for the group; these operations on the group apply to all
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
458 options in the group and its subgroups.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
459
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
460 Near the top of the customization buffer there are two lines
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
461 containing several active fields:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
462
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
463 @smallexample
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
464 [Set] [Save] [Reset] [Done]
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
465 @end smallexample
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
466
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
467 @noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
468 Invoking @samp{[Done]} buries this customization buffer. Each of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
469 other fields performs an operation---set, save or reset---on each of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
470 items in the buffer that could meaningfully be set, saved or reset.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
471
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
472 @node Face Customization
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
473 @subsubsection Customizing Faces
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
474 @cindex customizing faces
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
475 @cindex bold font
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
476 @cindex italic font
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
477 @cindex fonts and faces
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
478
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
479 In addition to user options, some customization groups also include
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
480 faces. When you show the contents of a group, both the user options and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
481 the faces in the group appear in the customization buffer. Here is an
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
482 example of how a face looks:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
483
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
484 @smallexample
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
485 Custom Changed Face: (sample)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
486 [State]: this face is unchanged from its standard setting.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
487 Face used when the customize item has been changed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
488 Parent groups: [Custom Magic Faces]
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
489 Attributes: [ ] Bold: [Toggle] off (nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
490 [ ] Italic: [Toggle] off (nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
491 [ ] Underline: [Toggle] off (nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
492 [ ] Foreground: white (sample)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
493 [ ] Background: blue (sample)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
494 [ ] Inverse: [Toggle] off (nil)
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
495 [ ] Stipple:
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
496 [ ] Font Family:
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
497 [ ] Size:
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
498 [ ] Strikethru: off
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
499 @end smallexample
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
500
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
501 Each face attribute has its own line. The @samp{[@var{x}]} field
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
502 before the attribute name indicates whether the attribute is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
503 @dfn{enabled}; @samp{X} means that it is. You can enable or disable the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
504 attribute by invoking that field. When the attribute is enabled, you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
505 can change the attribute value in the usual ways.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
506
1142
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
507 @xref{Faces}, for description of how @code{face-frob-from-locale-first}
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
508 variable affects changing @samp{Bold} and @samp{Italic} attributes.
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
509
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
510 @c Is this true for XEmacs?
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
511 @c On a black-and-white display, the colors you can use for the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
512 @c background are @samp{black}, @samp{white}, @samp{gray}, @samp{gray1},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
513 @c and @samp{gray3}. Emacs supports these shades of gray by using
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
514 @c background stipple patterns instead of a color.
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
515 @c
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
516 Setting, saving and resetting a face work like the same operations for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
517 options (@pxref{Changing an Option}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
518
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
519 A face can specify different appearances for different types of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
520 display. For example, a face can make text red on a color display, but
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
521 use a bold font on a monochrome display. To specify multiple
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
522 appearances for a face, select @samp{Show Display Types} in the menu you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
523 get from invoking @samp{[State]}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
524
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
525 @c It would be cool to implement this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
526 @c @findex modify-face
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
527 @c Another more basic way to set the attributes of a specific face is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
528 @c with @kbd{M-x modify-face}. This command reads the name of a face, then
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
529 @c reads the attributes one by one. For the color and stipple attributes,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
530 @c the attribute's current value is the default---type just @key{RET} if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
531 @c you don't want to change that attribute. Type @samp{none} if you want
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
532 @c to clear out the attribute.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
533
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
534 @node Specific Customization
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
535 @subsubsection Customizing Specific Items
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
536
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
537 Instead of finding the options you want to change by moving down
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
538 through the structure of groups, you can specify the particular option,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
539 face or group that you want to customize.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
540
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
541 @table @kbd
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
542 @item M-x customize-option @key{RET} @var{option} @key{RET}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
543 Set up a customization buffer with just one option, @var{option}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
544 @item M-x customize-face @key{RET} @var{face} @key{RET}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
545 Set up a customization buffer with just one face, @var{face}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
546 @item M-x customize-group @key{RET} @var{group} @key{RET}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
547 Set up a customization buffer with just one group, @var{group}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
548 @item M-x customize-apropos @key{RET} @var{regexp} @key{RET}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
549 Set up a customization buffer with all the options, faces and groups
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
550 that match @var{regexp}.
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
551 @item M-x customize-saved
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
552 Set up a customization buffer containing all options and faces that you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
553 have saved with customization buffers.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
554 @item M-x customize-customized
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
555 Set up a customization buffer containing all options and faces that you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
556 have customized but not saved.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
557 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
558
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
559 @findex customize-option
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
560 If you want to alter a particular user option variable with the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
561 customization buffer, and you know its name, you can use the command
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
562 @kbd{M-x customize-option} and specify the option name. This sets up
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
563 the customization buffer with just one option---the one that you asked
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
564 for. Editing, setting and saving the value work as described above, but
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
565 only for the specified option.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
566
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
567 @findex customize-face
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
568 Likewise, you can modify a specific face, chosen by name, using
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
569 @kbd{M-x customize-face}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
570
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
571 @findex customize-group
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
572 You can also set up the customization buffer with a specific group,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
573 using @kbd{M-x customize-group}. The immediate contents of the chosen
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
574 group, including option variables, faces, and other groups, all appear
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
575 as well. However, these subgroups' own contents start out hidden. You
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
576 can show their contents in the usual way, by invoking @samp{[Show]}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
577
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
578 @findex customize-apropos
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
579 To control more precisely what to customize, you can use @kbd{M-x
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
580 customize-apropos}. You specify a regular expression as argument; then
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
581 all options, faces and groups whose names match this regular expression
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
582 are set up in the customization buffer. If you specify an empty regular
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
583 expression, this includes @emph{all} groups, options and faces in the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
584 customization buffer (but that takes a long time).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
585
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
586 @findex customize-saved
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
587 @findex customize-customized
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
588 If you change option values and then decide the change was a mistake,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
589 you can use two special commands to revisit your previous changes. Use
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
590 @kbd{customize-saved} to look at the options and faces that you have
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
591 saved. Use @kbd{M-x customize-customized} to look at the options and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
592 faces that you have set but not saved.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
593
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
594 @node Edit Options
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
595 @subsection Editing Variable Values
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
596
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
597 @table @kbd
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
598 @item M-x list-options
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
599 Display a buffer listing names, values, and documentation of all options.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
600 @item M-x edit-options
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
601 Change option values by editing a list of options.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
602 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
603
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
604 @findex list-options
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
605 @kbd{M-x list-options} displays a list of all Emacs option variables in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
606 an Emacs buffer named @samp{*List Options*}. Each option is shown with its
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
607 documentation and its current value. Here is what a portion of it might
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
608 look like:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
609
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
610 @smallexample
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
611 ;; exec-path:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
612 ("." "/usr/local/bin" "/usr/ucb" "/bin" "/usr/bin" "/u2/emacs/etc")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
613 *List of directories to search programs to run in subprocesses.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
614 Each element is a string (directory name)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
615 or nil (try the default directory).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
616 ;;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
617 ;; fill-column:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
618 75
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
619 *Column beyond which automatic line-wrapping should happen.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
620 Automatically becomes local when set in any fashion.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
621 ;;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
622 @end smallexample
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
623
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
624 @findex edit-options
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
625 @kbd{M-x edit-options} goes one step further and immediately selects the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
626 @samp{*List Options*} buffer; this buffer uses the major mode Options mode,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
627 which provides commands that allow you to point at an option and change its
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
628 value:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
629
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
630 @table @kbd
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
631 @item s
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
632 Set the variable point is in or near to a new value read using the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
633 minibuffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
634 @item x
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
635 Toggle the variable point is in or near: if the value was @code{nil},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
636 it becomes @code{t}; otherwise it becomes @code{nil}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
637 @item 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
638 Set the variable point is in or near to @code{t}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
639 @item 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
640 Set the variable point is in or near to @code{nil}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
641 @item n
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
642 @itemx p
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
643 Move to the next or previous variable.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
644 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
645
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
646 @node Locals
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
647 @subsection Local Variables
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
648
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
649 @table @kbd
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
650 @item M-x make-local-variable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
651 Make a variable have a local value in the current buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
652 @item M-x kill-local-variable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
653 Make a variable use its global value in the current buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
654 @item M-x make-variable-buffer-local
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
655 Mark a variable so that setting it will make it local to the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
656 buffer that is current at that time.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
657 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
658
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
659 @cindex local variables
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
660 You can make any variable @dfn{local} to a specific Emacs buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
661 This means that the variable's value in that buffer is independent of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
662 its value in other buffers. A few variables are always local in every
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
663 buffer. All other Emacs variables have a @dfn{global} value which is in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
664 effect in all buffers that have not made the variable local.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
665
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
666 Major modes always make the variables they set local to the buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
667 This is why changing major modes in one buffer has no effect on other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
668 buffers.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
669
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
670 @findex make-local-variable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
671 @kbd{M-x make-local-variable} reads the name of a variable and makes it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
672 local to the current buffer. Further changes in this buffer will not
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
673 affect others, and changes in the global value will not affect this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
674 buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
675
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
676 @findex make-variable-buffer-local
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
677 @cindex per-buffer variables
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
678 @kbd{M-x make-variable-buffer-local} reads the name of a variable and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
679 changes the future behavior of the variable so that it automatically
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
680 becomes local when it is set. More precisely, once you have marked a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
681 variable in this way, the usual ways of setting the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
682 variable will automatically invoke @code{make-local-variable} first. We
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
683 call such variables @dfn{per-buffer} variables.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
684
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
685 Some important variables have been marked per-buffer already. They
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
686 include @code{abbrev-mode}, @code{auto-fill-function},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
687 @code{case-fold-search}, @code{comment-column}, @code{ctl-arrow},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
688 @code{fill-column}, @code{fill-prefix}, @code{indent-tabs-mode},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
689 @code{left-margin}, @*@code{mode-line-format}, @code{overwrite-mode},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
690 @code{selective-display-ellipses}, @*@code{selective-display},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
691 @code{tab-width}, and @code{truncate-lines}. Some other variables are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
692 always local in every buffer, but they are used for internal
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
693 purposes.@refill
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
694
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
695 Note: the variable @code{auto-fill-function} was formerly named
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
696 @code{auto-fill-hook}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
697
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
698 @findex kill-local-variable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
699 If you want a variable to cease to be local to the current buffer,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
700 call @kbd{M-x kill-local-variable} and provide the name of a variable to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
701 the prompt. The global value of the variable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
702 is again in effect in this buffer. Setting the major mode kills all
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
703 the local variables of the buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
704
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
705 @findex setq-default
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
706 To set the global value of a variable, regardless of whether the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
707 variable has a local value in the current buffer, you can use the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
708 Lisp function @code{setq-default}. It works like @code{setq}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
709 If there is a local value in the current buffer, the local value is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
710 not affected by @code{setq-default}; thus, the new global value may
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
711 not be visible until you switch to another buffer, as in the case of:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
712
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
713 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
714 (setq-default fill-column 75)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
715 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
716
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
717 @noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
718 @code{setq-default} is the only way to set the global value of a variable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
719 that has been marked with @code{make-variable-buffer-local}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
720
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
721 @findex default-value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
722 Programs can look at a variable's default value with @code{default-value}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
723 This function takes a symbol as an argument and returns its default value.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
724 The argument is evaluated; usually you must quote it explicitly, as in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
725 the case of:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
726
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
727 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
728 (default-value 'fill-column)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
729 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
730
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
731 @node File Variables
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
732 @subsection Local Variables in Files
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
733 @cindex local variables in files
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
734
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
735 A file can contain a @dfn{local variables list}, which specifies the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
736 values to use for certain Emacs variables when that file is edited.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
737 Visiting the file checks for a local variables list and makes each variable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
738 in the list local to the buffer in which the file is visited, with the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
739 value specified in the file.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
740
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
741 A local variables list goes near the end of the file, in the last page.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
742 (It is often best to put it on a page by itself.) The local variables list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
743 starts with a line containing the string @samp{Local Variables:}, and ends
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
744 with a line containing the string @samp{End:}. In between come the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
745 variable names and values, one set per line, as @samp{@var{variable}:@:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
746 @var{value}}. The @var{value}s are not evaluated; they are used literally.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
747
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
748 The line which starts the local variables list does not have to say
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
749 just @samp{Local Variables:}. If there is other text before @samp{Local
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
750 Variables:}, that text is called the @dfn{prefix}, and if there is other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
751 text after, that is called the @dfn{suffix}. If a prefix or suffix are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
752 present, each entry in the local variables list should have the prefix
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
753 before it and the suffix after it. This includes the @samp{End:} line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
754 The prefix and suffix are included to disguise the local variables list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
755 as a comment so the compiler or text formatter will ignore it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
756 If you do not need to disguise the local variables list as a comment in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
757 this way, there is no need to include a prefix or a suffix.@refill
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
758
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
759 Two ``variable'' names are special in a local variables list: a value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
760 for the variable @code{mode} sets the major mode, and a value for the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
761 variable @code{eval} is simply evaluated as an expression and the value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
762 is ignored. These are not real variables; setting them in any other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
763 context does not have the same effect. If @code{mode} is used in a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
764 local variables list, it should be the first entry in the list.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
765
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
766 Here is an example of a local variables list:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
767 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
768 ;;; Local Variables: ***
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
769 ;;; mode:lisp ***
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
770 ;;; comment-column:0 ***
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
771 ;;; comment-start: ";;; " ***
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
772 ;;; comment-end:"***" ***
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
773 ;;; End: ***
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
774 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
775
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
776 Note that the prefix is @samp{;;; } and the suffix is @samp{ ***}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
777 Note also that comments in the file begin with and end with the same
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
778 strings. Presumably the file contains code in a language which is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
779 enough like Lisp for Lisp mode to be useful but in which comments
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
780 start and end differently. The prefix and suffix are used in the local
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
781 variables list to make the list look like several lines of comments when
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
782 the compiler or interpreter for that language reads the file.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
783
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
784 The start of the local variables list must be no more than 3000
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
785 characters from the end of the file, and must be in the last page if the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
786 file is divided into pages. Otherwise, Emacs will not notice it is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
787 there. The purpose is twofold: a stray @samp{Local Variables:}@: not in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
788 the last page does not confuse Emacs, and Emacs never needs to search a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
789 long file that contains no page markers and has no local variables list.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
790
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
791 You may be tempted to turn on Auto Fill mode with a local variable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
792 list. That is inappropriate. Whether you use Auto Fill mode or not is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
793 a matter of personal taste, not a matter of the contents of particular
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
794 files. If you want to use Auto Fill, set up major mode hooks with your
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
795 init file to turn it on (when appropriate) for you alone
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
796 (@pxref{Init File}). Don't try to use a local variable list that would
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
797 impose your taste on everyone working with the file.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
798
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
799 XEmacs allows you to specify local variables in the first line
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
800 of a file, in addition to specifying them in the @code{Local Variables}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
801 section at the end of a file.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
802
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
803 If the first line of a file contains two occurrences of @code{`-*-'},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
804 XEmacs uses the information between them to determine what the major
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
805 mode and variable settings should be. For example, these are all legal:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
806
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
807 @example
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
808 ;;; -*- mode: emacs-lisp -*-
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
809 ;;; -*- mode: postscript; version-control: never -*-
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
810 ;;; -*- tags-file-name: "/foo/bar/TAGS" -*-
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
811 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
812
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
813 For historical reasons, the syntax @code{`-*- modename -*-'} is allowed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
814 as well; for example, you can use:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
815
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
816 @example
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
817 ;;; -*- emacs-lisp -*-
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
818 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
819
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
820 @vindex enable-local-variables
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
821 The variable @code{enable-local-variables} controls the use of local
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
822 variables lists in files you visit. The value can be @code{t},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
823 @code{nil}, or something else. A value of @code{t} means local variables
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
824 lists are obeyed; @code{nil} means they are ignored; anything else means
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
825 query.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
826
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
827 The command @code{M-x normal-mode} always obeys local variables lists
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
828 and ignores this variable.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
829
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
830 @node Keyboard Macros
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
831 @section Keyboard Macros
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
832
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
833 @cindex keyboard macros
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
834 A @dfn{keyboard macro} is a command defined by the user to abbreviate a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
835 sequence of keys. For example, if you discover that you are about to type
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
836 @kbd{C-n C-d} forty times, you can speed your work by defining a keyboard
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
837 macro to invoke @kbd{C-n C-d} and calling it with a repeat count of forty.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
838
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
839 @c widecommands
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
840 @table @kbd
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
841 @item C-x (
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
842 Start defining a keyboard macro (@code{start-kbd-macro}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
843 @item C-x )
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
844 End the definition of a keyboard macro (@code{end-kbd-macro}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
845 @item C-x e
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
846 Execute the most recent keyboard macro (@code{call-last-kbd-macro}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
847 @item C-u C-x (
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
848 Re-execute last keyboard macro, then add more keys to its definition.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
849 @item C-x q
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
850 When this point is reached during macro execution, ask for confirmation
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
851 (@code{kbd-macro-query}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
852 @item M-x name-last-kbd-macro
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
853 Give a command name (for the duration of the session) to the most
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
854 recently defined keyboard macro.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
855 @item M-x insert-kbd-macro
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
856 Insert in the buffer a keyboard macro's definition, as Lisp code.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
857 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
858
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
859 Keyboard macros differ from other Emacs commands in that they are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
860 written in the Emacs command language rather than in Lisp. This makes it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
861 easier for the novice to write them and makes them more convenient as
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
862 temporary hacks. However, the Emacs command language is not powerful
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
863 enough as a programming language to be useful for writing anything
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
864 general or complex. For such things, Lisp must be used.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
865
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
866 You define a keyboard macro by executing the commands which are its
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
867 definition. Put differently, as you are defining a keyboard macro, the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
868 definition is being executed for the first time. This way, you see
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
869 what the effects of your commands are, and don't have to figure
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
870 them out in your head. When you are finished, the keyboard macro is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
871 defined and also has been executed once. You can then execute the same
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
872 set of commands again by invoking the macro.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
873
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
874 @menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
875 * Basic Kbd Macro:: Defining and running keyboard macros.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
876 * Save Kbd Macro:: Giving keyboard macros names; saving them in files.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
877 * Kbd Macro Query:: Keyboard macros that do different things each use.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
878 @end menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
879
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
880 @node Basic Kbd Macro
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
881 @subsection Basic Use
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
882
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
883 @kindex C-x (
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
884 @kindex C-x )
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
885 @kindex C-x e
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
886 @findex start-kbd-macro
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
887 @findex end-kbd-macro
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
888 @findex call-last-kbd-macro
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
889 To start defining a keyboard macro, type @kbd{C-x (}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
890 (@code{start-kbd-macro}). From then on, anything you type continues to be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
891 executed, but also becomes part of the definition of the macro. @samp{Def}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
892 appears in the mode line to remind you of what is going on. When you are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
893 finished, the @kbd{C-x )} command (@code{end-kbd-macro}) terminates the
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
894 definition, without becoming part of it.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
895
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
896 For example,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
897
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
898 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
899 C-x ( M-f foo C-x )
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
900 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
901
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
902 @noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
903 defines a macro to move forward a word and then insert @samp{foo}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
904
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
905 You can give @kbd{C-x )} a repeat count as an argument, in which case it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
906 repeats the macro that many times right after defining it, but defining
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
907 the macro counts as the first repetition (since it is executed as you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
908 define it). If you give @kbd{C-x )} an argument of 4, it executes the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
909 macro immediately 3 additional times. An argument of zero to @kbd{C-x
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
910 e} or @kbd{C-x )} means repeat the macro indefinitely (until it gets an
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
911 error or you type @kbd{C-g}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
912
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
913 Once you have defined a macro, you can invoke it again with the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
914 @kbd{C-x e} command (@code{call-last-kbd-macro}). You can give the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
915 command a repeat count numeric argument to execute the macro many times.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
916
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
917 To repeat an operation at regularly spaced places in the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
918 text, define a macro and include as part of the macro the commands to move
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
919 to the next place you want to use it. For example, if you want to change
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
920 each line, you should position point at the start of a line, and define a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
921 macro to change that line and leave point at the start of the next line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
922 Repeating the macro will then operate on successive lines.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
923
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
924 After you have terminated the definition of a keyboard macro, you can add
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
925 to the end of its definition by typing @kbd{C-u C-x (}. This is equivalent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
926 to plain @kbd{C-x (} followed by retyping the whole definition so far. As
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
927 a consequence it re-executes the macro as previously defined.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
928
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
929 @node Save Kbd Macro
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
930 @subsection Naming and Saving Keyboard Macros
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
931
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
932 @findex name-last-kbd-macro
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
933 To save a keyboard macro for longer than until you define the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
934 next one, you must give it a name using @kbd{M-x name-last-kbd-macro}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
935 This reads a name as an argument using the minibuffer and defines that name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
936 to execute the macro. The macro name is a Lisp symbol, and defining it in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
937 this way makes it a valid command name for calling with @kbd{M-x} or for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
938 binding a key to with @code{global-set-key} (@pxref{Keymaps}). If you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
939 specify a name that has a prior definition other than another keyboard
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
940 macro, Emacs prints an error message and nothing is changed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
941
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
942 @findex insert-kbd-macro
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
943 Once a macro has a command name, you can save its definition in a file.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
944 You can then use it in another editing session. First visit the file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
945 you want to save the definition in. Then use the command:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
946
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
947 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
948 M-x insert-kbd-macro @key{RET} @var{macroname} @key{RET}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
949 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
950
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
951 @noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
952 This inserts some Lisp code that, when executed later, will define the same
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
953 macro with the same definition it has now. You need not understand Lisp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
954 code to do this, because @code{insert-kbd-macro} writes the Lisp code for you.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
955 Then save the file. You can load the file with @code{load-file}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
956 (@pxref{Lisp Libraries}). If the file you save in is your initialization file
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
957 (@pxref{Init File}), then the macro will be defined each
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
958 time you run Emacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
959
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
960 If you give @code{insert-kbd-macro} a prefix argument, it creates
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
961 additional Lisp code to record the keys (if any) that you have bound to the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
962 keyboard macro, so that the macro is reassigned the same keys when you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
963 load the file.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
964
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
965 @node Kbd Macro Query
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
966 @subsection Executing Macros With Variations
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
967
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
968 @kindex C-x q
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
969 @findex kbd-macro-query
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
970 You can use @kbd{C-x q} (@code{kbd-macro-query}), to get an effect similar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
971 to that of @code{query-replace}. The macro asks you each time
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
972 whether to make a change. When you are defining the macro, type @kbd{C-x
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
973 q} at the point where you want the query to occur. During macro
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
974 definition, the @kbd{C-x q} does nothing, but when you invoke the macro,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
975 @kbd{C-x q} reads a character from the terminal to decide whether to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
976 continue.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
977
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
978 The special answers to a @kbd{C-x q} query are @key{SPC}, @key{DEL},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
979 @kbd{C-d}, @kbd{C-l}, and @kbd{C-r}. Any other character terminates
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
980 execution of the keyboard macro and is then read as a command.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
981 @key{SPC} means to continue. @key{DEL} means to skip the remainder of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
982 this repetition of the macro, starting again from the beginning in the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
983 next repetition. @kbd{C-d} means to skip the remainder of this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
984 repetition and cancel further repetition. @kbd{C-l} redraws the frame
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
985 and asks you again for a character to specify what to do. @kbd{C-r} enters
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
986 a recursive editing level, in which you can perform editing that is not
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
987 part of the macro. When you exit the recursive edit using @kbd{C-M-c},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
988 you are asked again how to continue with the keyboard macro. If you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
989 type a @key{SPC} at this time, the rest of the macro definition is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
990 executed. It is up to you to leave point and the text in a state such
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
991 that the rest of the macro will do what you want.@refill
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
992
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
993 @kbd{C-u C-x q}, which is @kbd{C-x q} with a numeric argument, performs a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
994 different function. It enters a recursive edit reading input from the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
995 keyboard, both when you type it during the definition of the macro and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
996 when it is executed from the macro. During definition, the editing you do
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
997 inside the recursive edit does not become part of the macro. During macro
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
998 execution, the recursive edit gives you a chance to do some particularized
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
999 editing. @xref{Recursive Edit}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1000
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1001 @node Key Bindings
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1002 @section Customizing Key Bindings
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1003
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1004 This section deals with the @dfn{keymaps} that define the bindings
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1005 between keys and functions, and shows how you can customize these bindings.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1006 @cindex command
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1007 @cindex function
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1008 @cindex command name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1009
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1010 A command is a Lisp function whose definition provides for interactive
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1011 use. Like every Lisp function, a command has a function name, which is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1012 a Lisp symbol whose name usually consists of lower case letters and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1013 hyphens.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1014
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1015 @menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1016 * Keymaps:: Definition of the keymap data structure.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1017 Names of Emacs's standard keymaps.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1018 * Rebinding:: How to redefine one key's meaning conveniently.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1019 * Disabling:: Disabling a command means confirmation is required
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1020 before it can be executed. This is done to protect
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1021 beginners from surprises.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1022 @end menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1023
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1024 @node Keymaps
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1025 @subsection Keymaps
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1026 @cindex keymap
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1027
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1028 @cindex global keymap
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1029 @vindex global-map
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1030 The bindings between characters and command functions are recorded in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1031 data structures called @dfn{keymaps}. Emacs has many of these. One, the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1032 @dfn{global} keymap, defines the meanings of the single-character keys that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1033 are defined regardless of major mode. It is the value of the variable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1034 @code{global-map}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1035
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1036 @cindex local keymap
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1037 @vindex c-mode-map
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1038 @vindex lisp-mode-map
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1039 Each major mode has another keymap, its @dfn{local keymap}, which
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1040 contains overriding definitions for the single-character keys that are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1041 redefined in that mode. Each buffer records which local keymap is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1042 installed for it at any time, and the current buffer's local keymap is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1043 the only one that directly affects command execution. The local keymaps
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1044 for Lisp mode, C mode, and many other major modes always exist even when
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1045 not in use. They are the values of the variables @code{lisp-mode-map},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1046 @code{c-mode-map}, and so on. For less frequently used major modes, the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1047 local keymap is sometimes constructed only when the mode is used for the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1048 first time in a session, to save space.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1049
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1050 @cindex minibuffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1051 @vindex minibuffer-local-map
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1052 @vindex minibuffer-local-ns-map
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1053 @vindex minibuffer-local-completion-map
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1054 @vindex minibuffer-local-must-match-map
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1055 @vindex repeat-complex-command-map
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1056 @vindex isearch-mode-map
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1057 There are local keymaps for the minibuffer, too; they contain various
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1058 completion and exit commands.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1059
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1060 @itemize @bullet
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1061 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1062 @code{minibuffer-local-map} is used for ordinary input (no completion).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1063 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1064 @code{minibuffer-local-ns-map} is similar, except that @key{SPC} exits
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1065 just like @key{RET}. This is used mainly for Mocklisp compatibility.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1066 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1067 @code{minibuffer-local-completion-map} is for permissive completion.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1068 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1069 @code{minibuffer-local-must-match-map} is for strict completion and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1070 for cautious completion.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1071 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1072 @code{repeat-complex-command-map} is for use in @kbd{C-x @key{ESC}}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1073 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1074 @code{isearch-mode-map} contains the bindings of the special keys which
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1075 are bound in the pseudo-mode entered with @kbd{C-s} and @kbd{C-r}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1076 @end itemize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1077
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1078 @vindex ctl-x-map
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1079 @vindex help-map
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1080 @vindex esc-map
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1081 Finally, each prefix key has a keymap which defines the key sequences
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1082 that start with it. For example, @code{ctl-x-map} is the keymap used for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1083 characters following a @kbd{C-x}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1084
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1085 @itemize @bullet
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1086 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1087 @code{ctl-x-map} is the variable name for the map used for characters that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1088 follow @kbd{C-x}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1089 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1090 @code{help-map} is used for characters that follow @kbd{C-h}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1091 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1092 @code{esc-map} is for characters that follow @key{ESC}. All Meta
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1093 characters are actually defined by this map.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1094 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1095 @code{ctl-x-4-map} is for characters that follow @kbd{C-x 4}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1096 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1097 @code{mode-specific-map} is for characters that follow @kbd{C-c}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1098 @end itemize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1099
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1100 The definition of a prefix key is the keymap to use for looking up
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1101 the following character. Sometimes the definition is actually a Lisp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1102 symbol whose function definition is the following character keymap. The
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1103 effect is the same, but it provides a command name for the prefix key that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1104 you can use as a description of what the prefix key is for. Thus the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1105 binding of @kbd{C-x} is the symbol @code{Ctl-X-Prefix}, whose function
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1106 definition is the keymap for @kbd{C-x} commands, the value of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1107 @code{ctl-x-map}.@refill
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1108
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1109 Prefix key definitions can appear in either the global
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1110 map or a local map. The definitions of @kbd{C-c}, @kbd{C-x}, @kbd{C-h},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1111 and @key{ESC} as prefix keys appear in the global map, so these prefix
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1112 keys are always available. Major modes can locally redefine a key as a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1113 prefix by putting a prefix key definition for it in the local
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1114 map.@refill
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1115
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1116 A mode can also put a prefix definition of a global prefix character such
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1117 as @kbd{C-x} into its local map. This is how major modes override the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1118 definitions of certain keys that start with @kbd{C-x}. This case is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1119 special, because the local definition does not entirely replace the global
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1120 one. When both the global and local definitions of a key are other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1121 keymaps, the next character is looked up in both keymaps, with the local
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1122 definition overriding the global one. The character after the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1123 @kbd{C-x} is looked up in both the major mode's own keymap for redefined
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1124 @kbd{C-x} commands and in @code{ctl-x-map}. If the major mode's own keymap
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1125 for @kbd{C-x} commands contains @code{nil}, the definition from the global
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1126 keymap for @kbd{C-x} commands is used.@refill
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1127
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1128 @node Rebinding
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1129 @subsection Changing Key Bindings
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1130 @cindex key rebinding, this session
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1131 @cindex rebinding keys, this session
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1132
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1133 You can redefine an Emacs key by changing its entry in a keymap.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1134 You can change the global keymap, in which case the change is effective in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1135 all major modes except those that have their own overriding local
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1136 definitions for the same key. Or you can change the current buffer's
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1137 local map, which affects all buffers using the same major mode.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1138
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1139 @menu
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
1140 * Interactive Rebinding:: Changing Key Bindings Interactively
438
84b14dcb0985 Import from CVS: tag r21-2-27
cvs
parents: 428
diff changeset
1141 * Programmatic Rebinding:: Changing Key Bindings Programmatically
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
1142 * Key Bindings Using Strings:: Using Strings for Changing Key Bindings
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1143 @end menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1144
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1145 @node Interactive Rebinding
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1146 @subsubsection Changing Key Bindings Interactively
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1147 @findex global-set-key
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1148 @findex local-set-key
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1149 @findex local-unset-key
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1150
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1151 @table @kbd
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1152 @item M-x global-set-key @key{RET} @var{key} @var{cmd} @key{RET}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1153 Defines @var{key} globally to run @var{cmd}.
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
1154 @item M-x local-set-key @key{RET} @var{keys} @var{cmd} @key{RET}
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1155 Defines @var{key} locally (in the major mode now in effect) to run
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1156 @var{cmd}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1157 @item M-x local-unset-key @key{RET} @var{keys} @key{RET}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1158 Removes the local binding of @var{key}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1159 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1160
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1161 @var{cmd} is a symbol naming an interactively-callable function.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1162
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1163 When called interactively, @var{key} is the next complete key sequence
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1164 that you type. When called as a function, @var{key} is a string, a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1165 vector of events, or a vector of key-description lists as described in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1166 the @code{define-key} function description. The binding goes in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1167 the current buffer's local map, which is shared with other buffers in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1168 the same major mode.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1169
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1170 The following example:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1171
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1172 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1173 M-x global-set-key @key{RET} C-f next-line @key{RET}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1174 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1175
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1176 @noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1177 redefines @kbd{C-f} to move down a line. The fact that @var{cmd} is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1178 read second makes it serve as a kind of confirmation for @var{key}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1179
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1180 These functions offer no way to specify a particular prefix keymap as
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1181 the one to redefine in, but that is not necessary, as you can include
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1182 prefixes in @var{key}. @var{key} is read by reading characters one by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1183 one until they amount to a complete key (that is, not a prefix key).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1184 Thus, if you type @kbd{C-f} for @var{key}, Emacs enters
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1185 the minibuffer immediately to read @var{cmd}. But if you type
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1186 @kbd{C-x}, another character is read; if that character is @kbd{4},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1187 another character is read, and so on. For example,@refill
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1188
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1189 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1190 M-x global-set-key @key{RET} C-x 4 $ spell-other-window @key{RET}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1191 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1192
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1193 @noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1194 redefines @kbd{C-x 4 $} to run the (fictitious) command
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1195 @code{spell-other-window}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1196
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1197 @findex define-key
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1198 @findex substitute-key-definition
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1199 The most general way to modify a keymap is the function
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1200 @code{define-key}, used in Lisp code (such as your init file).
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1201 @code{define-key} takes three arguments: the keymap, the key to modify
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1202 in it, and the new definition. @xref{Init File}, for an example.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1203 @code{substitute-key-definition} is used similarly; it takes three
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1204 arguments, an old definition, a new definition, and a keymap, and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1205 redefines in that keymap all keys that were previously defined with the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1206 old definition to have the new definition instead.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1207
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1208 @node Programmatic Rebinding
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1209 @subsubsection Changing Key Bindings Programmatically
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1210
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1211 You can use the functions @code{global-set-key} and @code{define-key}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1212 to rebind keys under program control.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1213
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1214 @findex define-key
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1215 @findex global-set-key
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1216
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1217 @table @kbd
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1218 @item @code{(global-set-key @var{keys} @var{cmd})}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1219 Defines @var{keys} globally to run @var{cmd}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1220 @item @code{(define-key @var{keymap} @var{keys} @var{def})}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1221 Defines @var{keys} to run @var{def} in the keymap @var{keymap}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1222 @end table
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
1223
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1224 @var{keymap} is a keymap object.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1225
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1226 @var{keys} is the sequence of keystrokes to bind.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1227
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1228 @var{def} is anything that can be a key's definition:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1229
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1230 @itemize @bullet
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1231 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1232 @code{nil}, meaning key is undefined in this keymap
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1233 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1234 A command, that is, a Lisp function suitable for interactive calling
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1235 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1236 A string or key sequence vector, which is treated as a keyboard macro
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1237 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1238 A keymap to define a prefix key
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1239 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1240 A symbol so that when the key is looked up, the symbol stands for its
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1241 function definition, which should at that time be one of the above,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1242 or another symbol whose function definition is used, and so on
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1243 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1244 A cons, @code{(string . defn)}, meaning that @var{defn} is the definition
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1245 (@var{defn} should be a valid definition in its own right)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1246 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1247 A cons, @code{(keymap . char)}, meaning use the definition of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1248 @var{char} in map @var{keymap}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1249 @end itemize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1250
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1251 For backward compatibility, XEmacs allows you to specify key
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1252 sequences as strings. However, the preferred method is to use the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1253 representations of key sequences as vectors of keystrokes.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1254 @xref{Keystrokes}, for more information about the rules for constructing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1255 key sequences.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1256
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
1257 Emacs allows you to abbreviate representations for key sequences in
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1258 most places where there is no ambiguity.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1259 Here are some rules for abbreviation:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1260
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1261 @itemize @bullet
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1262 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1263 The keysym by itself is equivalent to a list of just that keysym, i.e.,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1264 @code{f1} is equivalent to @code{(f1)}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1265 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1266 A keystroke by itself is equivalent to a vector containing just that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1267 keystroke, i.e., @code{(control a)} is equivalent to @code{[(control a)]}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1268 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1269 You can use ASCII codes for keysyms that have them. i.e.,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1270 @code{65} is equivalent to @code{A}. (This is not so much an
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1271 abbreviation as an alternate representation.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1272 @end itemize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1273
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1274 Here are some examples of programmatically binding keys:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1275
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1276 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1277
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1278 ;;; Bind @code{my-command} to @key{f1}
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
1279 (global-set-key 'f1 'my-command)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1280
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1281 ;;; Bind @code{my-command} to @kbd{Shift-f1}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1282 (global-set-key '(shift f1) 'my-command)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1283
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1284 ;;; Bind @code{my-command} to @kbd{C-c Shift-f1}
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
1285 (global-set-key '[(control c) (shift f1)] 'my-command)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1286
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1287 ;;; Bind @code{my-command} to the middle mouse button.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1288 (global-set-key 'button2 'my-command)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1289
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1290 ;;; Bind @code{my-command} to @kbd{@key{META} @key{CTL} @key{Right Mouse Button}}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1291 ;;; in the keymap that is in force when you are running @code{dired}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1292 (define-key dired-mode-map '(meta control button3) 'my-command)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1293
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1294 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1295
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1296 @comment ;; note that these next four lines are not synonymous:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1297 @comment ;;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1298 @comment (global-set-key '(meta control delete) 'my-command)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1299 @comment (global-set-key '(meta control backspace) 'my-command)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1300 @comment (global-set-key '(meta control h) 'my-command)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1301 @comment (global-set-key '(meta control H) 'my-command)
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
1302 @comment
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1303 @comment ;; note that this binds two key sequences: ``control-j'' and ``linefeed''.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1304 @comment ;;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1305 @comment (global-set-key "\^J" 'my-command)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1306
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1307 @node Key Bindings Using Strings
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
1308 @subsubsection Using Strings for Changing Key Bindings
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1309
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1310 For backward compatibility, you can still use strings to represent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1311 key sequences. Thus you can use commands like the following:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1312
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1313 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1314 ;;; Bind @code{end-of-line} to @kbd{C-f}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1315 (global-set-key "\C-f" 'end-of-line)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1316 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1317
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1318 Note, however, that in some cases you may be binding more than one
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
1319 key sequence by using a single command. This situation can
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1320 arise because in ASCII, @kbd{C-i} and @key{TAB} have
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1321 the same representation. Therefore, when Emacs sees:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1322
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1323 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1324 (global-set-key "\C-i" 'end-of-line)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1325 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1326
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1327 it is unclear whether the user intended to bind @kbd{C-i} or @key{TAB}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1328 The solution XEmacs adopts is to bind both of these key
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1329 sequences.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1330
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1331 @cindex redefining keys
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1332 After binding a command to two key sequences with a form like:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1333
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1334 @example
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
1335 (define-key global-map "\^X\^I" 'command-1)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1336 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1337
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1338 it is possible to redefine only one of those sequences like so:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1339
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1340 @example
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
1341 (define-key global-map [(control x) (control i)] 'command-2)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
1342 (define-key global-map [(control x) tab] 'command-3)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1343 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1344
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1345 This applies only when running under a window system. If you are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1346 talking to Emacs through an ASCII-only channel, you do not get any of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1347 these features.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1348
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1349 Here is a table of pairs of key sequences that behave in a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1350 similar fashion:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1351
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1352 @example
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
1353 control h backspace
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1354 control l clear
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
1355 control i tab
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
1356 control m return
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
1357 control j linefeed
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1358 control [ escape
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1359 control @@ control space
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1360 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1361
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1362 @node Disabling
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1363 @subsection Disabling Commands
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1364 @cindex disabled command
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1365
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1366 Disabling a command marks it as requiring confirmation before it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1367 can be executed. The purpose of disabling a command is to prevent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1368 beginning users from executing it by accident and being confused.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1369
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1370 The direct mechanism for disabling a command is to have a non-@code{nil}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1371 @code{disabled} property on the Lisp symbol for the command. These
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1372 properties are normally set by the user's init file with
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1373 Lisp expressions such as:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1374
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1375 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1376 (put 'delete-region 'disabled t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1377 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1378
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1379 @xref{Init File}.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1380
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1381 If the value of the @code{disabled} property is a string, that string
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1382 is included in the message printed when the command is used:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1383
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1384 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1385 (put 'delete-region 'disabled
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1386 "Text deleted this way cannot be yanked back!\n")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1387 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1388
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1389 @findex disable-command
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1390 @findex enable-command
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1391 You can disable a command either by editing the init file
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1392 directly or with the command @kbd{M-x disable-command}, which edits the
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1393 init file for you. @xref{Init File}.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1394
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1395 When you attempt to invoke a disabled command interactively in Emacs,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1396 a window is displayed containing the command's name, its
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1397 documentation, and some instructions on what to do next; then
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1398 Emacs asks for input saying whether to execute the command as requested,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1399 enable it and execute, or cancel it. If you decide to enable the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1400 command, you are asked whether to do this permanently or just for the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1401 current session. Enabling permanently works by automatically editing
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1402 your init file. You can use @kbd{M-x enable-command} at any
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1403 time to enable any command permanently.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1404
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1405 Whether a command is disabled is independent of what key is used to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1406 invoke it; it also applies if the command is invoked using @kbd{M-x}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1407 Disabling a command has no effect on calling it as a function from Lisp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1408 programs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1409
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1410 @node Syntax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1411 @section The Syntax Table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1412 @cindex syntax table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1413
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1414 All the Emacs commands which parse words or balance parentheses are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1415 controlled by the @dfn{syntax table}. The syntax table specifies which
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1416 characters are opening delimiters, which are parts of words, which are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1417 string quotes, and so on. Actually, each major mode has its own syntax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1418 table (though sometimes related major modes use the same one) which it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1419 installs in each buffer that uses that major mode. The syntax table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1420 installed in the current buffer is the one that all commands use, so we
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1421 call it ``the'' syntax table. A syntax table is a Lisp object, a vector of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1422 length 256 whose elements are numbers.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1423
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1424 @menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1425 * Entry: Syntax Entry. What the syntax table records for each character.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1426 * Change: Syntax Change. How to change the information.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1427 @end menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1429 @node Syntax Entry
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1430 @subsection Information About Each Character
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1431
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1432 The syntax table entry for a character is a number that encodes six
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1433 pieces of information:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1434
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1435 @itemize @bullet
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1436 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1437 The syntactic class of the character, represented as a small integer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1438 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1439 The matching delimiter, for delimiter characters only
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1440 (the matching delimiter of @samp{(} is @samp{)}, and vice versa)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1441 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1442 A flag saying whether the character is the first character of a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1443 two-character comment starting sequence
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1444 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1445 A flag saying whether the character is the second character of a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1446 two-character comment starting sequence
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1447 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1448 A flag saying whether the character is the first character of a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1449 two-character comment ending sequence
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1450 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1451 A flag saying whether the character is the second character of a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1452 two-character comment ending sequence
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1453 @end itemize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1454
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1455 The syntactic classes are stored internally as small integers, but are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1456 usually described to or by the user with characters. For example, @samp{(}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1457 is used to specify the syntactic class of opening delimiters. Here is a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1458 table of syntactic classes, with the characters that specify them.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1459
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1460 @table @samp
871
732270854293 [xemacs-hg @ 2002-06-11 19:28:14 by adrian]
adrian
parents: 775
diff changeset
1461 @item @w{-}
732270854293 [xemacs-hg @ 2002-06-11 19:28:14 by adrian]
adrian
parents: 775
diff changeset
1462 The class of whitespace characters. Please don't use the formerly
732270854293 [xemacs-hg @ 2002-06-11 19:28:14 by adrian]
adrian
parents: 775
diff changeset
1463 advertised @w{ }, which is not supported by GNU Emacs.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1464 @item w
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1465 The class of word-constituent characters.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1466 @item _
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1467 The class of characters that are part of symbol names but not words.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1468 This class is represented by @samp{_} because the character @samp{_}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1469 has this class in both C and Lisp.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1470 @item .
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1471 The class of punctuation characters that do not fit into any other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1472 special class.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1473 @item (
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1474 The class of opening delimiters.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1475 @item )
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1476 The class of closing delimiters.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1477 @item '
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1478 The class of expression-adhering characters. These characters are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1479 part of a symbol if found within or adjacent to one, and are part
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1480 of a following expression if immediately preceding one, but are like
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1481 whitespace if surrounded by whitespace.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1482 @item "
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1483 The class of string-quote characters. They match each other in pairs,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1484 and the characters within the pair all lose their syntactic
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1485 significance except for the @samp{\} and @samp{/} classes of escape
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1486 characters, which can be used to include a string-quote inside the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1487 string.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1488 @item $
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1489 The class of self-matching delimiters. This is intended for @TeX{}'s
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1490 @samp{$}, which is used both to enter and leave math mode. Thus,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1491 a pair of matching @samp{$} characters surround each piece of math mode
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1492 @TeX{} input. A pair of adjacent @samp{$} characters act like a single
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1493 one for purposes of matching.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1494
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1495 @item /
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1496 The class of escape characters that always just deny the following
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1497 character its special syntactic significance. The character after one
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1498 of these escapes is always treated as alphabetic.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1499 @item \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1500 The class of C-style escape characters. In practice, these are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1501 treated just like @samp{/}-class characters, because the extra
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1502 possibilities for C escapes (such as being followed by digits) have no
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1503 effect on where the containing expression ends.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1504 @item <
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1505 The class of comment-starting characters. Only single-character
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1506 comment starters (such as @samp{;} in Lisp mode) are represented this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1507 way.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1508 @item >
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1509 The class of comment-ending characters. Newline has this syntax in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1510 Lisp mode.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1511 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1512
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1513 @vindex parse-sexp-ignore-comments
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1514 The characters flagged as part of two-character comment delimiters can
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1515 have other syntactic functions most of the time. For example, @samp{/} and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1516 @samp{*} in C code, when found separately, have nothing to do with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1517 comments. The comment-delimiter significance overrides when the pair of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1518 characters occur together in the proper order. Only the list and sexp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1519 commands use the syntax table to find comments; the commands specifically
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1520 for comments have other variables that tell them where to find comments.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1521 Moreover, the list and sexp commands notice comments only if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1522 @code{parse-sexp-ignore-comments} is non-@code{nil}. This variable is set
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1523 to @code{nil} in modes where comment-terminator sequences are liable to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1524 appear where there is no comment, for example, in Lisp mode where the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1525 comment terminator is a newline but not every newline ends a comment.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1526
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1527 @node Syntax Change
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1528 @subsection Altering Syntax Information
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1529
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1530 It is possible to alter a character's syntax table entry by storing a new
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1531 number in the appropriate element of the syntax table, but it would be hard
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1532 to determine what number to use. Emacs therefore provides a command that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1533 allows you to specify the syntactic properties of a character in a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1534 convenient way.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1535
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1536 @findex modify-syntax-entry
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1537 @kbd{M-x modify-syntax-entry} is the command to change a character's
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1538 syntax. It can be used interactively and is also used by major
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1539 modes to initialize their own syntax tables. Its first argument is the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1540 character to change. The second argument is a string that specifies the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1541 new syntax. When called from Lisp code, there is a third, optional
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1542 argument, which specifies the syntax table in which to make the change. If
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1543 not supplied, or if this command is called interactively, the third
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1544 argument defaults to the current buffer's syntax table.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1545
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1546 @enumerate
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1547 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1548 The first character in the string specifies the syntactic class. It
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1549 is one of the characters in the previous table (@pxref{Syntax Entry}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1550
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1551 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1552 The second character is the matching delimiter. For a character that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1553 is not an opening or closing delimiter, this should be a space, and may
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1554 be omitted if no following characters are needed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1555
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1556 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1557 The remaining characters are flags. The flag characters allowed are:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1558
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1559 @table @samp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1560 @item 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1561 Flag this character as the first of a two-character comment starting sequence.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1562 @item 2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1563 Flag this character as the second of a two-character comment starting sequence.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1564 @item 3
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1565 Flag this character as the first of a two-character comment ending sequence.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1566 @item 4
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1567 Flag this character as the second of a two-character comment ending sequence.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1568 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1569 @end enumerate
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1570
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1571 @kindex C-h s
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1572 @findex describe-syntax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1573 Use @kbd{C-h s} (@code{describe-syntax}) to display a description of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1574 the contents of the current syntax table. The description of each
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1575 character includes both the string you have to pass to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1576 @code{modify-syntax-entry} to set up that character's current syntax,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1577 and some English to explain that string if necessary.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1578
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1579 @node Init File
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1580 @section The Init File
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1581 @cindex init file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1582 @cindex Emacs initialization file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1583 @cindex key rebinding, permanent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1584 @cindex rebinding keys, permanently
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1585
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1586 When you start Emacs, it normally loads either @file{.xemacs/init.el}
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1587 or the file @file{.emacs} (whichever comes first) in your home directory.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1588 This file, if it exists, should contain Lisp code. It is called your
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1589 initialization file or @dfn{init file}. Use the command line switch
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1590 @samp{-q} to tell Emacs whether to load an init file (@pxref{Entering
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1591 Emacs}). Use the command line switch @samp{-user-init-file}
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1592 (@pxref{Command Switches}) to tell Emacs to load a different file
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1593 instead of @file{~/.xemacs/init.el}/@file{~/.emacs}.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1594
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1595 When the init file is read, the variable @code{user-init-file} says
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1596 which init file was loaded.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1597
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1598 At some sites there is a @dfn{default init file}, which is the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1599 library named @file{default.el}, found via the standard search path for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1600 libraries. The Emacs distribution contains no such library; your site
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1601 may create one for local customizations. If this library exists, it is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1602 loaded whenever you start Emacs. But your init file, if any, is loaded
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1603 first; if it sets @code{inhibit-default-init} non-@code{nil}, then
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1604 @file{default} is not loaded.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1605
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1606 If you have a large amount of code in your init file, you should
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1607 byte-compile it to @file{~/.xemacs/init.elc} or @file{~/.emacs.elc}.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1608
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1609 @menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1610 * Init Syntax:: Syntax of constants in Emacs Lisp.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1611 * Init Examples:: How to do some things with an init file.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1612 * Terminal Init:: Each terminal type can have an init file.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1613 @end menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1614
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1615 @node Init Syntax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1616 @subsection Init File Syntax
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1617
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1618 The init file contains one or more Lisp function call
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1619 expressions. Each consists of a function name followed by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1620 arguments, all surrounded by parentheses. For example, @code{(setq
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1621 fill-column 60)} represents a call to the function @code{setq} which is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1622 used to set the variable @code{fill-column} (@pxref{Filling}) to 60.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1623
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1624 The second argument to @code{setq} is an expression for the new value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1625 of the variable. This can be a constant, a variable, or a function call
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1626 expression. In the init file, constants are used most of the time.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1627 They can be:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1628
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1629 @table @asis
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1630 @item Numbers
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1631 Integers are written in decimal, with an optional initial minus sign.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1632
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1633 If a sequence of digits is followed by a period and another sequence
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1634 of digits, it is interpreted as a floating point number.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1635
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1636 The number prefixes @samp{#b}, @samp{#o}, and @samp{#x} are supported to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1637 represent numbers in binary, octal, and hexadecimal notation (or radix).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1638
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1639 @item Strings
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1640 Lisp string syntax is the same as C string syntax with a few extra
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1641 features. Use a double-quote character to begin and end a string constant.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1642
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1643 Newlines and special characters may be present literally in strings. They
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1644 can also be represented as backslash sequences: @samp{\n} for newline,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1645 @samp{\b} for backspace, @samp{\r} for return, @samp{\t} for tab,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1646 @samp{\f} for formfeed (control-l), @samp{\e} for escape, @samp{\\} for a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1647 backslash, @samp{\"} for a double-quote, or @samp{\@var{ooo}} for the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1648 character whose octal code is @var{ooo}. Backslash and double-quote are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1649 the only characters for which backslash sequences are mandatory.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1650
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1651 You can use @samp{\C-} as a prefix for a control character, as in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1652 @samp{\C-s} for ASCII Control-S, and @samp{\M-} as a prefix for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1653 a Meta character, as in @samp{\M-a} for Meta-A or @samp{\M-\C-a} for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1654 Control-Meta-A.@refill
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1655
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1656 @item Characters
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1657 Lisp character constant syntax consists of a @samp{?} followed by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1658 either a character or an escape sequence starting with @samp{\}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1659 Examples: @code{?x}, @code{?\n}, @code{?\"}, @code{?\)}. Note that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1660 strings and characters are not interchangeable in Lisp; some contexts
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1661 require one and some contexts require the other.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1662
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1663 @item True
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1664 @code{t} stands for `true'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1665
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1666 @item False
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1667 @code{nil} stands for `false'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1668
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1669 @item Other Lisp objects
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1670 Write a single-quote (') followed by the Lisp object you want.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1671 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1672
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1673 @node Init Examples
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1674 @subsection Init File Examples
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1675
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1676 Here are some examples of doing certain commonly desired things with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1677 Lisp expressions:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1678
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1679 @itemize @bullet
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1680 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1681 Make @key{TAB} in C mode just insert a tab if point is in the middle of a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1682 line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1683
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1684 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1685 (setq c-tab-always-indent nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1686 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1687
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1688 Here we have a variable whose value is normally @code{t} for `true'
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1689 and the alternative is @code{nil} for `false'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1690
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1691 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1692 Make searches case sensitive by default (in all buffers that do not
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1693 override this).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1694
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1695 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1696 (setq-default case-fold-search nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1697 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1698
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1699 This sets the default value, which is effective in all buffers that do
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1700 not have local values for the variable. Setting @code{case-fold-search}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1701 with @code{setq} affects only the current buffer's local value, which
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1702 is probably not what you want to do in an init file.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1703
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1704 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1705 Make Text mode the default mode for new buffers.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1706
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1707 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1708 (setq default-major-mode 'text-mode)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1709 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1710
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1711 Note that @code{text-mode} is used because it is the command for entering
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1712 the mode we want. A single-quote is written before it to make a symbol
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1713 constant; otherwise, @code{text-mode} would be treated as a variable name.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1714
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1715 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1716 Turn on Auto Fill mode automatically in Text mode and related modes.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1717
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1718 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1719 (setq text-mode-hook
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1720 '(lambda () (auto-fill-mode 1)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1721 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1722
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1723 Here we have a variable whose value should be a Lisp function. The
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1724 function we supply is a list starting with @code{lambda}, and a single
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1725 quote is written in front of it to make it (for the purpose of this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1726 @code{setq}) a list constant rather than an expression. Lisp functions
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1727 are not explained here; for mode hooks it is enough to know that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1728 @code{(auto-fill-mode 1)} is an expression that will be executed when
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1729 Text mode is entered. You could replace it with any other expression
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1730 that you like, or with several expressions in a row.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1731
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1732 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1733 (setq text-mode-hook 'turn-on-auto-fill)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1734 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1735
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1736 This is another way to accomplish the same result.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1737 @code{turn-on-auto-fill} is a symbol whose function definition is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1738 @code{(lambda () (auto-fill-mode 1))}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1739
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1740 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1741 Load the installed Lisp library named @file{foo} (actually a file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1742 @file{foo.elc} or @file{foo.el} in a standard Emacs directory).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1743
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1744 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1745 (load "foo")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1746 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1747
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1748 When the argument to @code{load} is a relative pathname, not starting
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1749 with @samp{/} or @samp{~}, @code{load} searches the directories in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1750 @code{load-path} (@pxref{Loading}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1751
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1752 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1753 Load the compiled Lisp file @file{foo.elc} from your home directory.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1754
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1755 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1756 (load "~/foo.elc")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1757 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1758
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1759 Here an absolute file name is used, so no searching is done.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1760
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1761 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1762 Rebind the key @kbd{C-x l} to run the function @code{make-symbolic-link}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1763
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1764 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1765 (global-set-key "\C-xl" 'make-symbolic-link)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1766 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1767
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1768 or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1769
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1770 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1771 (define-key global-map "\C-xl" 'make-symbolic-link)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1772 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1773
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1774 Note once again the single-quote used to refer to the symbol
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1775 @code{make-symbolic-link} instead of its value as a variable.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1776
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1777 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1778 Do the same thing for C mode only.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1779
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1780 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1781 (define-key c-mode-map "\C-xl" 'make-symbolic-link)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1782 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1783
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1784 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1785 Bind the function key @key{F1} to a command in C mode.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1786 Note that the names of function keys must be lower case.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1787
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1788 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1789 (define-key c-mode-map 'f1 'make-symbolic-link)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1790 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1791
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1792 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1793 Bind the shifted version of @key{F1} to a command.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1794
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1795 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1796 (define-key c-mode-map '(shift f1) 'make-symbolic-link)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1797 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1798
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1799 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1800 Redefine all keys which now run @code{next-line} in Fundamental mode
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1801 to run @code{forward-line} instead.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1802
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1803 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1804 (substitute-key-definition 'next-line 'forward-line
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1805 global-map)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1806 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1807
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1808 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1809 Make @kbd{C-x C-v} undefined.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1810
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1811 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1812 (global-unset-key "\C-x\C-v")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1813 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1814
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1815 One reason to undefine a key is so that you can make it a prefix.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1816 Simply defining @kbd{C-x C-v @var{anything}} would make @kbd{C-x C-v}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1817 a prefix, but @kbd{C-x C-v} must be freed of any non-prefix definition
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1818 first.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1819
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1820 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1821 Make @samp{$} have the syntax of punctuation in Text mode.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1822 Note the use of a character constant for @samp{$}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1823
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1824 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1825 (modify-syntax-entry ?\$ "." text-mode-syntax-table)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1826 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1827
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1828 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1829 Enable the use of the command @code{eval-expression} without confirmation.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1830
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1831 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1832 (put 'eval-expression 'disabled nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1833 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1834 @end itemize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1835
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1836 @node Terminal Init
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1837 @subsection Terminal-Specific Initialization
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1838
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1839 Each terminal type can have a Lisp library to be loaded into Emacs when
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1840 it is run on that type of terminal. For a terminal type named
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1841 @var{termtype}, the library is called @file{term/@var{termtype}} and it is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1842 found by searching the directories @code{load-path} as usual and trying the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1843 suffixes @samp{.elc} and @samp{.el}. Normally it appears in the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1844 subdirectory @file{term} of the directory where most Emacs libraries are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1845 kept.@refill
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1846
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1847 The usual purpose of the terminal-specific library is to define the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1848 escape sequences used by the terminal's function keys using the library
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1849 @file{keypad.el}. See the file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1850 @file{term/vt100.el} for an example of how this is done.@refill
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1851
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1852 When the terminal type contains a hyphen, only the part of the name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1853 before the first hyphen is significant in choosing the library name.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1854 Thus, terminal types @samp{aaa-48} and @samp{aaa-30-rv} both use
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1855 the library @file{term/aaa}. The code in the library can use
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1856 @code{(getenv "TERM")} to find the full terminal type name.@refill
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1857
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1858 @vindex term-file-prefix
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1859 The library's name is constructed by concatenating the value of the
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1860 variable @code{term-file-prefix} and the terminal type. Your init
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1861 file can prevent the loading of the terminal-specific library by setting
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1862 @code{term-file-prefix} to @code{nil}. @xref{Init File}.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1863
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1864 @vindex term-setup-hook
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1865 The value of the variable @code{term-setup-hook}, if not @code{nil}, is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1866 called as a function of no arguments at the end of Emacs initialization,
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1867 after both your init file and any terminal-specific library have been
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1868 read. @xref{Init File}. You can set the value in the init file to
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1869 override part of any of the terminal-specific libraries and to define
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1870 initializations for terminals that do not have a library.@refill
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1871
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1872 @node Audible Bell
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1873 @section Changing the Bell Sound
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1874 @cindex audible bell, changing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1875 @cindex bell, changing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1876 @vindex sound-alist
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1877 @findex load-default-sounds
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1878 @findex play-sound
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1879
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1880 You can now change how the audible bell sounds using the variable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1881 @code{sound-alist}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1882
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1883 @code{sound-alist}'s value is an list associating symbols with, among
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1884 other things, strings of audio-data. When @code{ding} is called with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1885 one of the symbols, the associated sound data is played instead of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1886 standard beep. This only works if you are logged in on the console of a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1887 machine with audio hardware. To listen to a sound of the provided type,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1888 call the function @code{play-sound} with the argument @var{sound}. You
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
1889 can also set the volume of the sound with the optional argument
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1890 @var{volume}.@refill
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1891 @cindex ding
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1892
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1893 Each element of @code{sound-alist} is a list describing a sound.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1894 The first element of the list is the name of the sound being defined.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1895 Subsequent elements of the list are alternating keyword/value pairs:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1896
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1897 @table @code
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1898 @item sound
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
1899 A string of raw sound data, or the name of another sound to play.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1900 The symbol @code{t} here means use the default X beep.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1901
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1902 @item volume
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1903 An integer from 0-100, defaulting to @code{bell-volume}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1904
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1905 @item pitch
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1906 If using the default X beep, the pitch (Hz) to generate.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1907
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1908 @item duration
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1909 If using the default X beep, the duration (milliseconds).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1910 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1911
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1912 For compatibility, elements of `sound-alist' may also be of the form:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1913
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1914 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1915 ( @var{sound-name} . @var{<sound>} )
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1916 ( @var{sound-name} @var{<volume>} @var{<sound>} )
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1917 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1918
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1919 You should probably add things to this list by calling the function
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1920 @code{load-sound-file}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1921
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1922 Note that you can only play audio data if running on the console screen
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1923 of a machine with audio hardware which emacs understands, which at this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1924 time means a Sun SparcStation, SGI, or HP9000s700.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1925
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1926 Also note that the pitch, duration, and volume options are available
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1927 everywhere, but most X servers ignore the `pitch' option.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1928
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1929 @vindex bell-volume
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1930 The variable @code{bell-volume} should be an integer from 0 to 100,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1931 with 100 being loudest, which controls how loud the sounds emacs makes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1932 should be. Elements of the @code{sound-alist} may override this value.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1933 This variable applies to the standard X bell sound as well as sound files.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1934
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1935 If the symbol @code{t} is in place of a sound-string, Emacs uses the
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
1936 default X beep. This allows you to define beep-types of
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1937 different volumes even when not running on the console.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1938
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1939 @findex load-sound-file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1940 You can add things to this list by calling the function
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1941 @code{load-sound-file}, which reads in an audio-file and adds its data to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1942 the sound-alist. You can specify the sound with the @var{sound-name}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1943 argument and the file into which the sounds are loaded with the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1944 @var{filename} argument. The optional @var{volume} argument sets the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1945 volume.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1946
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1947 @code{load-sound-file (@var{filename sound-name} &optional @var{volume})}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1948
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1949 To load and install some sound files as beep-types, use the function
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1950 @code{load-default-sounds} (note that this only works if you are on
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1951 display 0 of a machine with audio hardware).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1952
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1953 The following beep-types are used by Emacs itself. Other Lisp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1954 packages may use other beep types, but these are the ones that the C
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1955 kernel of Emacs uses.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1956
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1957 @table @code
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1958 @item auto-save-error
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1959 An auto-save does not succeed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1960
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1961 @item command-error
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1962 The Emacs command loop catches an error
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1963
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1964 @item undefined-key
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1965 You type a key that is undefined
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1966
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
1967 @item undefined-click
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1968 You use an undefined mouse-click combination
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1969
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
1970 @item no-completion
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1971 Completion was not possible
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1972
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
1973 @item y-or-n-p
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1974 You type something other than the required @code{y} or @code{n}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1975
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
1976 @item yes-or-no-p
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1977 You type something other than @code{yes} or @code{no}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1978 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1979
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1980 @comment node-name, next, previous, up
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1981 @node Faces
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1982 @section Faces
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1983
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1984 XEmacs has objects called extents and faces. An @dfn{extent}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1985 is a region of text and a @dfn{face} is a collection of textual
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1986 attributes, such as fonts and colors. Every extent is displayed in some
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1987 face; therefore, changing the properties of a face immediately updates the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1988 display of all associated extents. Faces can be frame-local: you can
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1989 have a region of text that displays with completely different
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1990 attributes when its buffer is viewed from a different X window.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1991
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1992 The display attributes of faces may be specified either in Lisp or through
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1993 the X resource manager.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1994
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1995 @subsection Customizing Faces
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1996
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1997 You can change the face of an extent with the functions in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1998 this section. All the functions prompt for a @var{face} as an
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1999 argument; use completion for a list of possible values.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2000
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2001 @table @kbd
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2002 @item M-x invert-face
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2003 Swap the foreground and background colors of the given @var{face}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2004 @item M-x make-face-bold
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2005 Make the font of the given @var{face} bold. When called from a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2006 program, returns @code{nil} if this is not possible.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2007 @item M-x make-face-bold-italic
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
2008 Make the font of the given @var{face} bold italic.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2009 When called from a program, returns @code{nil} if not possible.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2010 @item M-x make-face-italic
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
2011 Make the font of the given @var{face} italic.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2012 When called from a program, returns @code{nil} if not possible.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2013 @item M-x make-face-unbold
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
2014 Make the font of the given @var{face} non-bold.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2015 When called from a program, returns @code{nil} if not possible.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2016 @item M-x make-face-unitalic
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2017 Make the font of the given @var{face} non-italic.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2018 When called from a program, returns @code{nil} if not possible.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2019 @item M-x make-face-larger
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2020 Make the font of the given @var{face} a little larger.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2021 When called from a program, returns @code{nil} if not possible.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2022 @item M-x make-face-smaller
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2023 Make the font of the given @var{face} a little smaller.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2024 When called from a program, returns @code{nil} if not possible.
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
2025 @item M-x set-face-background
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2026 Change the background color of the given @var{face}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2027 @item M-x set-face-background-pixmap
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2028 Change the background pixmap of the given @var{face}.
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
2029 @item M-x set-face-background-pixmap-file
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
2030 A simpler version but with filename completion.
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
2031 @item M-x set-face-font
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2032 Change the font of the given @var{face}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2033 @item M-x set-face-foreground
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2034 Change the foreground color of the given @var{face}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2035 @item M-x set-face-underline-p
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2036 Change whether the given @var{face} is underlined.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2037 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2038
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2039 @findex make-face-larger
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2040 @findex make-face-smaller
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2041
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2042 @findex invert-face
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2043 You can exchange the foreground and background color of the selected
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2044 @var{face} with the function @code{invert-face}. If the face does not
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2045 specify both foreground and background, then its foreground and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2046 background are set to the background and foreground of the default face.
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
2047 When calling this from a program, you can supply the optional argument
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2048 @var{frame} to specify which frame is affected; otherwise, all frames
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2049 are affected.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2050
1142
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
2051 @findex make-face-bold
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
2052 @findex make-face-bold-italic
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
2053 @findex make-face-italic
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
2054 @findex make-face-unbold
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
2055 @findex make-face-unitalic
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
2056 @vindex face-frob-from-locale-first
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
2057 The work of @code{make-face-bold}, @code{make-face-bold-italic},
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
2058 @code{make-face-italic}, @code{make-face-unbold},
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
2059 @code{make-face-unitalic} functions is affected by
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
2060 @code{face-frob-from-locale-first} variable. If it is @code{nil}, those
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
2061 functions first try to manipulate device specific data like X font names
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
2062 to obtain the desired font face specification. This may be unsuitable
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
2063 in environments using different font face specifications for different
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
2064 frames, non-Mule environments in particular.
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
2065
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
2066 If the variable is non-@code{nil}, those functions first try to figure
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
2067 out whether the face font is the same as one of predefined faces:
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
2068 @code{default}, @code{bold}, @code{italic}, @code{bold-italic}. If it
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
2069 is the same, then the new face font specification is set to be the same
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
2070 as that of a corresponding predefined face. Thus if the predefined face
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
2071 is set up properly for different frames, the same will hold for the face
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
2072 being changed by the functions. This is the behavior one might desire
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
2073 in non-Mule environments mentioned above: face being changed still looks
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
2074 right in all frames.
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
2075
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
2076 How predefined faces might be set up for different frames in such an
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
2077 environments is described in @ref{Face Resources}.
55834f418dfb [xemacs-hg @ 2002-12-04 14:00:37 by stephent]
stephent
parents: 1137
diff changeset
2078
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2079 @findex set-face-background
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2080 You can set the background color of the specified @var{face} with the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2081 function @code{set-face-background}. The argument @code{color} should
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2082 be a string, the name of a color. When called from a program, if the
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
2083 optional @var{frame} argument is provided, the face is changed only
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2084 in that frame; otherwise, it is changed in all frames.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2085
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2086 @findex set-face-background-pixmap
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2087 You can set the background pixmap of the specified @var{face} with the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2088 function @code{set-face-background-pixmap}. The pixmap argument
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2089 @var{name} should be a string, the name of a file of pixmap data. The
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2090 directories listed in the @code{x-bitmap-file-path} variable are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2091 searched. The bitmap may also be a list of the form @code{(@var{width
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2092 height data})}, where @var{width} and @var{height} are the size in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2093 pixels, and @var{data} is a string containing the raw bits of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2094 bitmap. If the optional @var{frame} argument is provided, the face is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2095 changed only in that frame; otherwise, it is changed in all frames.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2096
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2097 The variable @code{x-bitmap-file-path} takes as a value a list of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2098 directories in which X bitmap files may be found. If the value is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2099 @code{nil}, the list is initialized from the @code{*bitmapFilePath}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2100 resource.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2101
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2102 If the environment variable @b{XBMLANGPATH} is set, then it is consulted
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2103 before the @code{x-bitmap-file-path} variable.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2104
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
2105 @findex set-face-background-pixmap
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
2106 Alternately, you can use a simpler version of
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
2107 @code{set-face-background-pixmap} called
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
2108 @code{set-face-background-pixmap-file}. This function does not give you
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
2109 as much control on the pixmap instanciator, but provides filename
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
2110 completion.
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
2111
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2112 @findex set-face-font
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2113 You can set the font of the specified @var{face} with the function
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2114 @code{set-face-font}. The @var{font} argument should be a string, the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2115 name of a font. When called from a program, if the
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
2116 optional @var{frame} argument is provided, the face is changed only
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2117 in that frame; otherwise, it is changed in all frames.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2118
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
2119 @findex set-face-foreground
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2120 You can set the foreground color of the specified @var{face} with the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2121 function @code{set-face-foreground}. The argument @var{color} should be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2122 a string, the name of a color. If the optional @var{frame} argument is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2123 provided, the face is changed only in that frame; otherwise, it is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2124 changed in all frames.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2125
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2126 @findex set-face-underline-p
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2127 You can set underline the specified @var{face} with the function
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2128 @code{set-face-underline-p}. The argument @var{underline-p} can be used
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2129 to make underlining an attribute of the face or not. If the optional
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2130 @var{frame} argument is provided, the face is changed only in that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2131 frame; otherwise, it is changed in all frames.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2132
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2133 @node Frame Components
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2134 @section Frame Components
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2135
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2136 You can control the presence and position of most frame components, such
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2137 as the menubar, toolbars, and gutters.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2138
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2139 This section is not written yet. Try the Lisp Reference Manual:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2140 @ref{Menubar,,,lispref,}, @ref{Toolbar Intro,,,lispref,}, and
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2141 @ref{Gutter Intro,,,lispref,}.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2142
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2143 @node X Resources
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2144 @section X Resources
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2145 @cindex X resources
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2146 @findex x-create-frame
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2147
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2148 Historically, XEmacs has used the X resource application class @samp{Emacs}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2149 for its resources. Unfortunately, GNU Emacs uses the same application
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2150 class, and resources are not compatible between the two Emacsen. This
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2151 sharing of the application class often leads to trouble if you want to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2152 run both variants.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2153
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2154 Starting with XEmacs 21, XEmacs uses the class @samp{XEmacs} if it finds
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2155 any XEmacs resources in the resource database when the X connection is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2156 initialized. Otherwise, it will use the class @samp{Emacs} for
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
2157 backwards compatibility. The variable @var{x-emacs-application-class}
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2158 may be consulted to determine the application class being used.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2159
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2160 The examples in this section assume the application class is @samp{Emacs}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2161
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
2162 The Emacs resources are generally set per-frame. Each Emacs frame can have
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
2163 its own name or the same name as another, depending on the name passed to the
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2164 @code{make-frame} function.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2165
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2166 You can specify resources for all frames with the syntax:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2167
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2168 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2169 Emacs*parameter: value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2170 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2171 @noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2172
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2173 or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2174
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2175 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2176 Emacs*EmacsFrame.parameter:value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2177 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2178 @noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2179
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2180 You can specify resources for a particular frame with the syntax:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2181
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2182 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2183 Emacs*FRAME-NAME.parameter: value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2184 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2185 @noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2186
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2187 @menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2188 * Geometry Resources:: Controlling the size and position of frames.
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
2189 * Iconic Resources:: Controlling whether frames come up iconic.
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
2190 * Resource List:: List of resources settable on a frame or device.
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
2191 * Face Resources:: Controlling faces using resources.
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
2192 * Widgets:: The widget hierarchy for XEmacs.
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 438
diff changeset
2193 * Menubar Resources:: Specifying resources for the menubar.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2194 @end menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2195
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2196 @node Geometry Resources
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2197 @subsection Geometry Resources
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2198
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2199 To make the default size of all Emacs frames be 80 columns by 55 lines,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2200 do this:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2201
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2202 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2203 Emacs*EmacsFrame.geometry: 80x55
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2204 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2205 @noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2206
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2207 To set the geometry of a particular frame named @samp{fred}, do this:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2208
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2209 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2210 Emacs*fred.geometry: 80x55
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2211 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2212 @noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2213
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2214 Important! Do not use the following syntax:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2215
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2216 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2217 Emacs*geometry: 80x55
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2218 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2219 @noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2220
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2221 You should never use @code{*geometry} with any X application. It does
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2222 not say "make the geometry of Emacs be 80 columns by 55 lines." It
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2223 really says, "make Emacs and all subwindows thereof be 80x55 in whatever
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2224 units they care to measure in." In particular, that is both telling the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2225 Emacs text pane to be 80x55 in characters, and telling the menubar pane
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2226 to be 80x55 pixels, which is surely not what you want.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2227
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2228 As a special case, this geometry specification also works (and sets the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2229 default size of all Emacs frames to 80 columns by 55 lines):
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2230
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2231 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2232 Emacs.geometry: 80x55
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2233 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2234 @noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2235
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2236 since that is the syntax used with most other applications (since most
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2237 other applications have only one top-level window, unlike Emacs). In
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2238 general, however, the top-level shell (the unmapped ApplicationShell
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2239 widget named @samp{Emacs} that is the parent of the shell widgets that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2240 actually manage the individual frames) does not have any interesting
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2241 resources on it, and you should set the resources on the frames instead.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2242
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2243 The @code{-geometry} command-line argument sets only the geometry of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2244 initial frame created by Emacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2245
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2246 A more complete explanation of geometry-handling is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2247
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2248 @itemize @bullet
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2249 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2250 The @code{-geometry} command-line option sets the @code{Emacs.geometry}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2251 resource, that is, the geometry of the ApplicationShell.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2252
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2253 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2254 For the first frame created, the size of the frame is taken from the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2255 ApplicationShell if it is specified, otherwise from the geometry of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2256 frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2257
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2258 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2259 For subsequent frames, the order is reversed: First the frame, and then
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2260 the ApplicationShell.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2261
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2262 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2263 For the first frame created, the position of the frame is taken from the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2264 ApplicationShell (@code{Emacs.geometry}) if it is specified, otherwise
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2265 from the geometry of the frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2266
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2267 @item
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
2268 For subsequent frames, the position is taken only from the frame, and
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2269 never from the ApplicationShell.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2270 @end itemize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2271
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2272 This is rather complicated, but it does seem to provide the most
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2273 intuitive behavior with respect to the default sizes and positions of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2274 frames created in various ways.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2275
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2276 @node Iconic Resources
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2277 @subsection Iconic Resources
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2278
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2279 Analogous to @code{-geometry}, the @code{-iconic} command-line option
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2280 sets the iconic flag of the ApplicationShell (@code{Emacs.iconic}) and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2281 always applies to the first frame created regardless of its name.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2282 However, it is possible to set the iconic flag on particular frames (by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2283 name) by using the @code{Emacs*FRAME-NAME.iconic} resource.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2284
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2285 @node Resource List
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2286 @subsection Resource List
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2287
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2288 Emacs frames accept the following resources:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2289
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2290 @table @asis
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2291 @item @code{geometry} (class @code{Geometry}): string
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2292 Initial geometry for the frame. @xref{Geometry Resources}, for a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2293 complete discussion of how this works.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2294
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2295 @item @code{iconic} (class @code{Iconic}): boolean
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2296 Whether this frame should appear in the iconified state.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2297
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2298 @item @code{internalBorderWidth} (class @code{InternalBorderWidth}): int
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
2299 How many blank pixels to leave between the text and the edge of the
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2300 window.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2301
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2302 @item @code{interline} (class @code{Interline}): int
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2303 How many pixels to leave between each line (may not be implemented).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2304
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2305 @item @code{menubar} (class @code{Menubar}): boolean
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2306 Whether newly-created frames should initially have a menubar. Set to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2307 true by default.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2308
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2309 @item @code{initiallyUnmapped} (class @code{InitiallyUnmapped}): boolean
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2310 Whether XEmacs should leave the initial frame unmapped when it starts
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2311 up. This is useful if you are starting XEmacs as a server (e.g. in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2312 conjunction with gnuserv or the external client widget). You can also
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2313 control this with the @code{-unmapped} command-line option.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2314
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2315 @item @code{barCursor} (class @code{BarColor}): boolean
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2316 Whether the cursor should be displayed as a bar, or the traditional box.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2317
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2318 @item @code{cursorColor} (class @code{CursorColor}): color-name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2319 The color of the text cursor.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2320
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2321 @item @code{scrollBarWidth} (class @code{ScrollBarWidth}): integer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2322 How wide the vertical scrollbars should be, in pixels; 0 means no
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2323 vertical scrollbars. You can also use a resource specification of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2324 form @code{*scrollbar.width}, or the usual toolkit scrollbar resources:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2325 @code{*XmScrollBar.width} (Motif), @code{*XlwScrollBar.width} (Lucid),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2326 or @code{*Scrollbar.thickness} (Athena). We don't recommend that you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2327 use the toolkit resources, though, because they're dependent on how
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2328 exactly your particular build of XEmacs was configured.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2329
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2330 @item @code{scrollBarHeight} (class @code{ScrollBarHeight}): integer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2331 How high the horizontal scrollbars should be, in pixels; 0 means no
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2332 horizontal scrollbars. You can also use a resource specification of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2333 form @code{*scrollbar.height}, or the usual toolkit scrollbar resources:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2334 @code{*XmScrollBar.height} (Motif), @code{*XlwScrollBar.height} (Lucid),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2335 or @code{*Scrollbar.thickness} (Athena). We don't recommend that you use
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2336 the toolkit resources, though, because they're dependent on how exactly
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2337 your particular build of XEmacs was configured.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2338
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2339 @item @code{scrollBarPlacement} (class @code{ScrollBarPlacement}): string
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2340 Where the horizontal and vertical scrollbars should be positioned. This
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2341 should be one of the four strings @samp{BOTTOM_LEFT},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2342 @samp{BOTTOM_RIGHT}, @samp{TOP_LEFT}, and @samp{TOP_RIGHT}. Default is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2343 @samp{BOTTOM_RIGHT} for the Motif and Lucid scrollbars and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2344 @samp{BOTTOM_LEFT} for the Athena scrollbars.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2345
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2346 @item @code{topToolBarHeight} (class @code{TopToolBarHeight}): integer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2347 @itemx @code{bottomToolBarHeight} (class @code{BottomToolBarHeight}): integer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2348 @itemx @code{leftToolBarWidth} (class @code{LeftToolBarWidth}): integer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2349 @itemx @code{rightToolBarWidth} (class @code{RightToolBarWidth}): integer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2350 Height and width of the four possible toolbars.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2351
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2352 @item @code{topToolBarShadowColor} (class @code{TopToolBarShadowColor}): color-name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2353 @itemx @code{bottomToolBarShadowColor} (class @code{BottomToolBarShadowColor}): color-name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2354 Color of the top and bottom shadows for the toolbars. NOTE: These resources
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2355 do @emph{not} have anything to do with the top and bottom toolbars (i.e. the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2356 toolbars at the top and bottom of the frame)! Rather, they affect the top
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2357 and bottom shadows around the edges of all four kinds of toolbars.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2358
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2359 @item @code{topToolBarShadowPixmap} (class @code{TopToolBarShadowPixmap}): pixmap-name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2360 @itemx @code{bottomToolBarShadowPixmap} (class @code{BottomToolBarShadowPixmap}): pixmap-name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2361 Pixmap of the top and bottom shadows for the toolbars. If set, these
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2362 resources override the corresponding color resources. NOTE: These
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2363 resources do @emph{not} have anything to do with the top and bottom
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2364 toolbars (i.e. the toolbars at the top and bottom of the frame)!
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2365 Rather, they affect the top and bottom shadows around the edges of all
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2366 four kinds of toolbars.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2367
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2368 @item @code{toolBarShadowThickness} (class @code{ToolBarShadowThickness}): integer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2369 Thickness of the shadows around the toolbars, in pixels.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2370
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2371 @item @code{visualBell} (class @code{VisualBell}): boolean
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2372 Whether XEmacs should flash the screen rather than making an audible beep.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2373
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2374 @item @code{bellVolume} (class @code{BellVolume}): integer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2375 Volume of the audible beep.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2376
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2377 @item @code{useBackingStore} (class @code{UseBackingStore}): boolean
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2378 Whether XEmacs should set the backing-store attribute of the X windows
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2379 it creates. This increases the memory usage of the X server but decreases
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2380 the amount of X traffic necessary to update the screen, and is useful
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2381 when the connection to the X server goes over a low-bandwidth line
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2382 such as a modem connection.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2383 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2384
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2385 Emacs devices accept the following resources:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2386
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2387 @table @asis
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2388 @item @code{textPointer} (class @code{Cursor}): cursor-name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2389 The cursor to use when the mouse is over text. This resource is used to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2390 initialize the variable @code{x-pointer-shape}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2391
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2392 @item @code{selectionPointer} (class @code{Cursor}): cursor-name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2393 The cursor to use when the mouse is over a selectable text region (an
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2394 extent with the @samp{highlight} property; for example, an Info
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2395 cross-reference). This resource is used to initialize the variable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2396 @code{x-selection-pointer-shape}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2397
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2398 @item @code{spacePointer} (class @code{Cursor}): cursor-name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2399 The cursor to use when the mouse is over a blank space in a buffer (that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2400 is, after the end of a line or after the end-of-file). This resource is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2401 used to initialize the variable @code{x-nontext-pointer-shape}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2402
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2403 @item @code{modeLinePointer} (class @code{Cursor}): cursor-name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2404 The cursor to use when the mouse is over a modeline. This resource is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2405 used to initialize the variable @code{x-mode-pointer-shape}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2406
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2407 @item @code{gcPointer} (class @code{Cursor}): cursor-name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2408 The cursor to display when a garbage-collection is in progress. This
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2409 resource is used to initialize the variable @code{x-gc-pointer-shape}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2410
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2411 @item @code{scrollbarPointer} (class @code{Cursor}): cursor-name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2412 The cursor to use when the mouse is over the scrollbar. This resource
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2413 is used to initialize the variable @code{x-scrollbar-pointer-shape}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2414
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2415 @item @code{pointerColor} (class @code{Foreground}): color-name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2416 @itemx @code{pointerBackground} (class @code{Background}): color-name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2417 The foreground and background colors of the mouse cursor. These
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2418 resources are used to initialize the variables
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2419 @code{x-pointer-foreground-color} and @code{x-pointer-background-color}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2420 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2421
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2422 @node Face Resources
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2423 @subsection Face Resources
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2424
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2425 The attributes of faces are also per-frame. They can be specified as:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2426
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2427 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2428 Emacs.FACE_NAME.parameter: value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2429 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2430 @noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2431
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2432 or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2433
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2434 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2435 Emacs*FRAME_NAME.FACE_NAME.parameter: value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2436 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2437 @noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2438
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2439 Faces accept the following resources:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2440
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2441 @table @asis
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2442 @item @code{attributeFont} (class @code{AttributeFont}): font-name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2443 The font of this face.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2444
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2445 @item @code{attributeForeground} (class @code{AttributeForeground}): color-name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2446 @itemx @code{attributeBackground} (class @code{AttributeBackground}): color-name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2447 The foreground and background colors of this face.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2448
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2449 @item @code{attributeBackgroundPixmap} (class @code{AttributeBackgroundPixmap}): file-name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2450 The name of an @sc{xbm} file (or @sc{xpm} file, if your version of Emacs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2451 supports @sc{xpm}), to use as a background stipple.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2452
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2453 @item @code{attributeUnderline} (class @code{AttributeUnderline}): boolean
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2454 Whether text in this face should be underlined.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2455 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2456
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2457 All text is displayed in some face, defaulting to the face named
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2458 @code{default}. To set the font of normal text, use
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2459 @code{Emacs*default.attributeFont}. To set it in the frame named
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2460 @code{fred}, use @code{Emacs*fred.default.attributeFont}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2461
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2462 These are the names of the predefined faces:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2463
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2464 @table @code
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2465 @item default
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2466 Everything inherits from this.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2467
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2468 @item bold
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2469 If this is not specified in the resource database, Emacs tries to find a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2470 bold version of the font of the default face.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2471
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2472 @item italic
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2473 If this is not specified in the resource database, Emacs tries to find
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2474 an italic version of the font of the default face.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2475
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2476 @item bold-italic
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2477 If this is not specified in the resource database, Emacs tries to find a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2478 bold-italic version of the font of the default face.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2479
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2480 @item modeline
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2481 This is the face that the modeline is displayed in. If not specified in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2482 the resource database, it is determined from the default face by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2483 reversing the foreground and background colors.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2484
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2485 @item highlight
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2486 This is the face that highlighted extents (for example, Info
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2487 cross-references and possible completions, when the mouse passes over
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2488 them) are displayed in.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2489
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2490 @item left-margin
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2491 @itemx right-margin
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2492 These are the faces that the left and right annotation margins are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2493 displayed in.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2494
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2495 @item zmacs-region
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2496 This is the face that mouse selections are displayed in.
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
2497
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2498 @item isearch
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2499 This is the face that the matched text being searched for is displayed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2500 in.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2501
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2502 @item info-node
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2503 This is the face of info menu items. If unspecified, it is copied from
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2504 @code{bold-italic}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2505
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2506 @item info-xref
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2507 This is the face of info cross-references. If unspecified, it is copied
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2508 from @code{bold}. (Note that, when the mouse passes over a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2509 cross-reference, the cross-reference's face is determined from a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2510 combination of the @code{info-xref} and @code{highlight} faces.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2511 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2512
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2513 Other packages might define their own faces; to see a list of all faces,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2514 use any of the interactive face-manipulation commands such as
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2515 @code{set-face-font} and type @samp{?} when you are prompted for the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2516 name of a face.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2517
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2518 If the @code{bold}, @code{italic}, and @code{bold-italic} faces are not
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2519 specified in the resource database, then XEmacs attempts to derive them
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2520 from the font of the default face. It can only succeed at this if you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2521 have specified the default font using the XLFD (X Logical Font
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2522 Description) format, which looks like
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2523
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2524 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2525 *-courier-medium-r-*-*-*-120-*-*-*-*-*-*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2526 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2527 @noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2528
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2529 If you use any of the other, less strict font name formats, some of which
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2530 look like
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2531
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2532 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2533 lucidasanstypewriter-12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2534 fixed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2535 9x13
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2536 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2537
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2538 then XEmacs won't be able to guess the names of the bold and italic
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2539 versions. All X fonts can be referred to via XLFD-style names, so you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2540 should use those forms. See the man pages for @samp{X(1)},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2541 @samp{xlsfonts(1)}, and @samp{xfontsel(1)}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2542
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2543 @node Widgets
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2544 @subsection Widgets
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2545
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2546 There are several structural widgets between the terminal EmacsFrame
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2547 widget and the top level ApplicationShell; the exact names and types of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2548 these widgets change from release to release (for example, they changed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2549 between 19.8 and 19.9, 19.9 and 19.10, and 19.10 and 19.12) and are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2550 subject to further change in the future, so you should avoid mentioning
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2551 them in your resource database. The above-mentioned syntaxes should be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2552 forward- compatible. As of 19.13, the exact widget hierarchy is as
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2553 follows:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2554
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2555 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2556 INVOCATION-NAME "shell" "container" FRAME-NAME
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2557 x-emacs-application-class "EmacsShell" "EmacsManager" "EmacsFrame"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2558 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2559
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2560 where INVOCATION-NAME is the terminal component of the name of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2561 XEmacs executable (usually @samp{xemacs}), and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2562 @samp{x-emacs-application-class} is generally @samp{Emacs}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2563
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2564 @node Menubar Resources
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2565 @subsection Menubar Resources
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2566
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2567 As the menubar is implemented as a widget which is not a part of XEmacs
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2568 proper, it does not use the face mechanism for specifying fonts and
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2569 colors: It uses whatever resources are appropriate to the type of widget
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2570 which is used to implement it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2571
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2572 If Emacs was compiled to use only the Lucid Motif-lookalike menu widgets,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2573 then one way to specify the font of the menubar would be
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2574
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2575 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2576 Emacs*menubar*font: *-courier-medium-r-*-*-*-120-*-*-*-*-*-*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2577 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2578
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
2579 If both the Lucid Motif-lookalike menu widgets and X Font Sets are
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2580 configured to allow multilingual menubars, then one uses
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2581
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2582 @example
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2583 *menubar*FontSet: -*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-*, \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2584 -*-*-*-*-*-*-*-120-*-jisx0208.1983-0
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2585 @end example
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2586
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2587 That would specify fonts for a Japanese menubar. Specifying only one
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2588 XLFD is acceptable; specifying more than one for a given registry
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2589 (language) is also allowed. When X Font Sets are configured, some .font
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2590 resources (eg, menubars) are ignored in favor of the corresponding
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2591 .fontSet resources.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
2592
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
2593 If the Motif library is being used, then one would have to use
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2594
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2595 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2596 Emacs*menubar*fontList: *-courier-medium-r-*-*-*-120-*-*-*-*-*-*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2597 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2598
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2599 because the Motif library uses the @code{fontList} resource name instead
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2600 of @code{font}, which has subtly different semantics.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2601
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 871
diff changeset
2602 The same is true of the scrollbars: They accept whichever resources are
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2603 appropriate for the toolkit in use.