(Directory Variables): Fix wording of last change.
[bpt/emacs.git] / doc / emacs / custom.texi
index e270f86..1cf6f7d 100644 (file)
@@ -6,33 +6,24 @@
 @chapter Customization
 @cindex customization
 
-  This chapter talks about various topics relevant to adapting the
-behavior of Emacs in ways we have anticipated.
+  This chapter describes some simple methods to customize the behavior
+of Emacs.
+
+  Apart from the methods described here, see @ref{X Resources} for
+information about using X resources to customize Emacs, and see
+@ref{Keyboard Macros} for information about recording and replaying
+keyboard macros.  Making more far-reaching and open-ended changes
+involves writing Emacs Lisp code; see
 @iftex
-See @cite{The Emacs Lisp Reference Manual}
+@cite{The Emacs Lisp Reference Manual}.
 @end iftex
 @ifnottex
-@xref{Top, Emacs Lisp, Emacs Lisp, elisp, The Emacs Lisp
-Reference Manual},
+@ref{Top, Emacs Lisp, Emacs Lisp, elisp, The Emacs Lisp
+Reference Manual}.
 @end ifnottex
-for how to make more far-reaching and open-ended changes.  @xref{X
-Resources}, for information on using X resources to customize Emacs.
-
-  Customization that you do within Emacs normally affects only the
-particular Emacs session that you do it in---it does not persist
-between sessions unless you save the customization in a file such as
-your init file (@file{.emacs}) that will affect future sessions.
-(@xref{Init File}.)  When you tell the customization buffer to save
-customizations for future sessions, this actually works by editing
-@file{.emacs} for you.
-
-  Another means of customization is the keyboard macro, which is a
-sequence of keystrokes to be replayed with a single command.
-@xref{Keyboard Macros}, for full instruction how to record, manage, and
-replay sequences of keys.
 
 @menu
-* Minor Modes::                Each minor mode is one feature you can turn on
+* Minor Modes::                Each minor mode is a feature you can turn on
                          independently of any others.
 * Easy Customization::  Convenient way to browse and change settings.
 * Variables::          Many Emacs commands examine Emacs variables
@@ -52,164 +43,170 @@ replay sequences of keys.
 @cindex mode, minor
 
   Minor modes are optional features which you can turn on or off.  For
-example, Auto Fill mode is a minor mode in which @key{SPC} breaks lines
-between words as you type.  All the minor modes are independent of each
-other and of the selected major mode.  Most minor modes say in the mode
-line when they are enabled; for example, @samp{Fill} in the mode line means
-that Auto Fill mode is enabled.
-
-  You should append @code{-mode} to the name of a minor mode to
-produce the name of the command that turns the mode on or off.  Thus,
-the command to enable or disable Auto Fill mode is called
-@code{auto-fill-mode}.  These commands are usually invoked with
-@kbd{M-x}, but you can bind keys to them if you wish.
-
-  With no argument, the minor mode function turns the mode on if it
-was off, and off if it was on.  This is known as @dfn{toggling}.  A
-positive argument always turns the mode on, and an explicit zero
-argument or a negative argument always turns it off.
-
-  Some minor modes are global: while enabled, they affect everything
-you do in the Emacs session, in all buffers.  Other minor modes are
-buffer-local; they apply only to the current buffer, so you can enable
-the mode in certain buffers and not others.
-
-  For most minor modes, the command name is also the name of a
-variable.  The variable's value is non-@code{nil} if the mode is
-enabled and @code{nil} if it is disabled.  Some minor-mode commands
-work by just setting the variable.  For example, the command
-@code{abbrev-mode} works by setting the value of @code{abbrev-mode} as
-a variable; it is this variable that directly turns Abbrev mode on and
-off.  You can directly set the variable's value instead of calling the
-mode function.  For other minor modes, you need to either set the
-variable through the Customize interface or call the mode function to
-correctly enable or disable the mode.  To check which of these two
-possibilities applies to a given minor mode, use @kbd{C-h v} to ask
-for documentation on the variable name.
-
-  For minor mode commands that work by just setting the minor mode
-variable, that variable provides a good way for Lisp programs to turn
-minor modes on and off; it is also useful in a file's local variables
-list (@pxref{File Variables}).  But please think twice before setting
-minor modes with a local variables list, because most minor modes are
-a matter of user preference---other users editing the same file might
-not want the same minor modes you prefer.
-
-  The most useful buffer-local minor modes include Abbrev mode, Auto
-Fill mode, Auto Save mode, Font-Lock mode, Glasses mode, Outline minor
-mode, Overwrite mode, and Binary Overwrite mode.
-
-  Abbrev mode allows you to define abbreviations that automatically expand
-as you type them.  For example, @samp{amd} might expand to @samp{abbrev
-mode}.  @xref{Abbrevs}, for full information.
-
-  Auto Fill mode allows you to enter filled text without breaking lines
-explicitly.  Emacs inserts newlines as necessary to prevent lines from
+example, Auto Fill mode is a minor mode in which @key{SPC} breaks
+lines between words as you type.  Minor modes are independent of one
+another and of the selected major mode.  Most minor modes say in the
+mode line when they are enabled; for example, @samp{Fill} in the mode
+line means that Auto Fill mode is enabled.
+
+  Each minor mode is associated with a command, called the @dfn{mode
+command}, which turns it on or off.  The name of this command consists
+of the name of the minor mode, followed by @samp{-mode}; for instance,
+the mode command for Auto Fill mode is @code{auto-fill-mode}.  Calling
+the minor mode command with no prefix argument @dfn{toggles} the mode,
+turning it on if it was off, and off if it was on.  A positive
+argument always turns the mode on, and a zero or negative argument
+always turns it off.  Mode commands are usually invoked with
+@kbd{M-x}, but you can bind keys to them if you wish (@pxref{Key
+Bindings}).
+
+  Most minor modes also have a @dfn{mode variable}, with the same name
+as the mode command.  Its value is non-@code{nil} if the mode is
+enabled, and @code{nil} if it is disabled.  In some minor modes---but
+not all---the value of the variable alone determines whether the mode
+is active: the mode command works simply by setting the variable, and
+changing the value of the variable has the same effect as calling the
+mode command.  Because not all minor modes work this way, we recommend
+that you avoid changing the mode variables directly; use the mode
+commands instead.
+
+  Some minor modes are @dfn{buffer-local}: they apply only to the
+current buffer, so you can enable the mode in certain buffers and not
+others.  Other minor modes are @dfn{global}: while enabled, they
+affect everything you do in the Emacs session, in all buffers.  Some
+global minor modes are enabled by default.
+
+  The following is a list of some buffer-local minor modes:
+
+@itemize @bullet
+@item
+Abbrev mode automatically expands text based on pre-defined
+abbreviation definitions.  @xref{Abbrevs}.
+
+@item
+Auto Fill mode inserts newlines as you type to prevent lines from
 becoming too long.  @xref{Filling}.
 
-  Auto Save mode saves the buffer contents periodically to reduce the
+@item
+Auto Save mode saves the buffer contents periodically to reduce the
 amount of work you can lose in case of a crash.  @xref{Auto Save}.
 
-  Enriched mode enables editing and saving of formatted text.
+@item
+Enriched mode enables editing and saving of formatted text.
 @xref{Formatted Text}.
 
-  Flyspell mode automatically highlights misspelled words.
+@item
+Flyspell mode automatically highlights misspelled words.
 @xref{Spelling}.
 
-  Font-Lock mode automatically highlights certain textual units found
-in programs, such as comments, strings, and function names being
-defined.  This requires a display that can show multiple fonts or
-colors.  @xref{Faces}.
+@item
+Font-Lock mode automatically highlights certain textual units found in
+programs.  It is enabled globally by default, but you can disable it
+in individual buffers.  @xref{Faces}.
 
-@ignore
-  ISO Accents mode makes the characters @samp{`}, @samp{'}, @samp{"},
-@samp{^}, @samp{/} and @samp{~} combine with the following letter, to
-produce an accented letter in the ISO Latin-1 character set.  The
-newer and more general feature of input methods more or less
-supersedes ISO Accents mode.  @xref{Unibyte Mode}.
-@end ignore
+@findex linum-mode
+@cindex Linum mode
+@item
+Linum mode displays each line's line number in the window's left
+margin.  Its mode command is @code{linum-mode}.
 
-  Outline minor mode provides the same facilities as the major mode
-called Outline mode; but since it is a minor mode instead, you can
-combine it with any major mode.  @xref{Outline Mode}.
+@item
+Outline minor mode provides similar facilities to the major mode
+called Outline mode.  @xref{Outline Mode}.
 
 @cindex Overwrite mode
 @cindex mode, Overwrite
-  Overwrite mode causes ordinary printing characters to replace existing
-text instead of shoving it to the right.  For example, if point is in
-front of the @samp{B} in @samp{FOOBAR}, then in Overwrite mode typing a
-@kbd{G} changes it to @samp{FOOGAR}, instead of producing @samp{FOOGBAR}
-as usual.  In Overwrite mode, the command @kbd{C-q} inserts the next
-character whatever it may be, even if it is a digit---this gives you a
-way to insert a character instead of replacing an existing character.
-
 @findex overwrite-mode
 @kindex INSERT
-  The command @code{overwrite-mode} is an exception to the rule that
-commands which toggle minor modes are normally not bound to keys: it is
-bound to the @key{INSERT} function key.  This is because many other
-programs bind @key{INSERT} to similar functions.
+@item
+Overwrite mode causes ordinary printing characters to replace existing
+text instead of shoving it to the right.  For example, if point is in
+front of the @samp{B} in @samp{FOOBAR}, then in Overwrite mode typing
+a @kbd{G} changes it to @samp{FOOGAR}, instead of producing
+@samp{FOOGBAR} as usual.  In Overwrite mode, the command @kbd{C-q}
+inserts the next character whatever it may be, even if it is a
+digit---this gives you a way to insert a character instead of
+replacing an existing character.  The mode command,
+@code{overwrite-mode}, is bound to the @key{Insert} key.
 
 @findex binary-overwrite-mode
-  Binary Overwrite mode is a variant of Overwrite mode for editing
-binary files; it treats newlines and tabs like other characters, so that
-they overwrite other characters and can be overwritten by them.
-In Binary Overwrite mode, digits after @kbd{C-q} specify an
-octal character code, as usual.
-
-  Here are some useful minor modes that normally apply to all buffers
-at once.  Since Line Number mode and Transient Mark mode can be
-enabled or disabled just by setting the value of the minor mode
-variable, you @emph{can} set them differently for particular buffers,
-by explicitly making the corresponding variable local in those
-buffers.  @xref{Locals}.
-
-  Icomplete mode displays an indication of available completions when
+@item
+Binary Overwrite mode is a variant of Overwrite mode for editing
+binary files; it treats newlines and tabs like other characters, so
+that they overwrite other characters and can be overwritten by them.
+In Binary Overwrite mode, digits after @kbd{C-q} specify an octal
+character code, as usual.
+
+@item
+Visual Line mode performs ``word wrapping'', causing long lines to be
+wrapped at word boundaries.  @xref{Visual Line Mode}.
+@end itemize
+
+  Here are some useful global minor modes.  Since Line Number mode and
+Transient Mark mode can be enabled or disabled just by setting the
+value of the minor mode variable, you @emph{can} set them differently
+for particular buffers, by explicitly making the corresponding
+variable local in those buffers.  @xref{Locals}.
+
+@itemize @bullet
+@item
+Column Number mode enables display of the current column number in the
+mode line.  @xref{Mode Line}.
+
+@item
+Delete Selection mode causes text insertion to first delete the text
+in the region, if the region is active.  @xref{Using Region}.
+
+@item
+Icomplete mode displays an indication of available completions when
 you are in the minibuffer and completion is active.  @xref{Completion
 Options}.
 
-  Line Number mode enables continuous display in the mode line of the
-line number of point, and Column Number mode enables display of the
-column number.  @xref{Mode Line}.
+@item
+Line Number mode enables display of the current line number in the
+mode line.  It is enabled by default.  @xref{Mode Line}.
 
-  Scroll Bar mode gives each window a scroll bar (@pxref{Scroll Bars}).
-Menu Bar mode gives each frame a menu bar (@pxref{Menu Bars}).  Both of
-these modes are enabled by default when you use the X Window System.
+@item
+Menu Bar mode gives each frame a menu bar.  It is enabled by default.
+@xref{Menu Bars}.
 
-  In Transient Mark mode, every change in the buffer contents
-``deactivates'' the mark, so that commands that operate on the region
-will get an error.  This means you must either set the mark, or
-explicitly ``reactivate'' it, before each command that uses the region.
-The advantage of Transient Mark mode is that Emacs can display the
-region highlighted.  @xref{Mark}.
+@item
+Scroll Bar mode gives each window a scroll bar.  It is enabled by
+default, but the scroll bar is only displayed on graphical terminals.
+@xref{Scroll Bars}.
+
+@item
+Tool Bar mode gives each frame a tool bar.  It is enabled by default,
+but the tool bar is only displayed on graphical terminals.  @xref{Tool
+Bars}.
+
+@item
+Transient Mark mode highlights the region, and makes many Emacs
+commands operate on the region when the mark is active.  It is enabled
+by default.  @xref{Mark}.
+@end itemize
 
 @node Easy Customization
 @section Easy Customization Interface
 
 @cindex settings
-  Emacs has many @dfn{settings} which have values that you can specify
-in order to customize various commands.  Many are documented in this
-manual.  Most settings are @dfn{user options}---that is to say, Lisp
-variables (@pxref{Variables})---so their names appear in the Variable
-Index (@pxref{Variable Index}).  The other settings are faces and
-their attributes (@pxref{Faces}).
+  Emacs has many @dfn{settings} which have values that you can change.
+Many are documented in this manual.  Most settings are @dfn{user
+options}---that is to say, Lisp variables (@pxref{Variables})---and
+their names appear in the Variable Index (@pxref{Variable Index}).
+The other settings are faces and their attributes (@pxref{Faces}).
 
 @findex customize
 @cindex customization buffer
-  You can browse interactively through settings and change them using
-@kbd{M-x customize}.  This command creates a @dfn{customization
-buffer}, which offers commands to navigate through a logically
-organized structure of the Emacs settings; you can also use it to edit
-and set their values, and to save settings permanently in your
-@file{~/.emacs} file (@pxref{Init File}).
-
-  The appearance of the example buffers in this section is typically
-different under a graphical display, since faces are then used to indicate
-buttons, links and editable fields.
+  You can browse settings and change them using @kbd{M-x customize}.
+This creates a @dfn{customization buffer}, which lets you navigate
+through a logically organized list of settings, edit and set their
+values, and save them permanently in your initialization file
+(@pxref{Init File}).
 
 @menu
-* Groups: Customization Groups.   How settings are classified in a structure.
-* Browsing: Browsing Custom.   Browsing and searching for settings.
+* Customization Groups::     How settings are classified in a structure.
+* Browsing Custom::          Browsing and searching for settings.
 * Changing a Variable::      How to edit an option's value and set the option.
 * Saving Customizations::    Specifying the file for saving customizations.
 * Face Customization::       How to edit the attributes of a face.
@@ -236,16 +233,14 @@ under it.  It looks like this, in part:
 @page
 @smallexample
 @group
-/- Emacs group: ---------------------------------------------------\
+/- Emacs group: Customization of the One True Editor. -------------\
       [State]: visible group members are all at standard values.
-   Customization of the One True Editor.
+   
    See also [Manual].
 
-Editing group: [Go to Group]
-Basic text editing facilities.
+[Editing] : Basic text editing facilities.
 
-External group: [Go to Group]
-Interfacing to external utilities.
+[External] : Interfacing to external utilities.
 
 @var{more second-level groups}
 
@@ -270,19 +265,18 @@ There are also @dfn{buttons} and @dfn{links}, which do something when
 you @dfn{invoke} them.  To invoke a button or a link, either click on
 it with @kbd{Mouse-1}, or move point to it and type @key{RET}.
 
-  For example, the phrase @samp{[State]} that appears in
-a second-level group is a button.  It operates on the same
-customization buffer.  The phrase @samp{[Go to Group]} is a kind
-of hypertext link to another group.  Invoking it creates a new
-customization buffer, which shows that group and its contents.
+  For example, the phrase @samp{[State]} that appears in a
+second-level group is a button.  It operates on the same customization
+buffer.  Each group name, such as @samp{[Editing]}, is a hypertext
+link to that group; invoking it creates a new customization buffer,
+showing the group and its contents.
 
-  The @code{Emacs} group includes a few settings, but mainly it
-contains other groups, which contain more groups, which contain the
-settings.  By browsing the hierarchy of groups, you will eventually
-find the feature you are interested in customizing.  Then you can use
-the customization buffer to set that feature's settings.  You can also
-go straight to a particular group by name, using the command @kbd{M-x
-customize-group}.
+  The @code{Emacs} group only contains other groups.  These groups, in
+turn, can contain settings or still more groups.  By browsing the
+hierarchy of groups, you will eventually find the feature you are
+interested in customizing.  Then you can use the customization buffer
+to set that feature's settings.  You can also go straight to a
+particular group by name, using the command @kbd{M-x customize-group}.
 
 @node Browsing Custom
 @subsection Browsing and Searching for Options and Faces
@@ -439,9 +433,9 @@ field; @kbd{S-@key{TAB}} (@code{widget-backward}) moves backward to
 the previous button or editable field.
 
   Typing @key{RET} on an editable field also moves forward, just like
-@key{TAB}.  We set it up this way because people often type @key{RET}
-when they are finished editing a field.  To insert a newline within an
-editable field, use @kbd{C-o} or @kbd{C-q C-j}.
+@key{TAB}.  You can thus type @key{RET} when you are finished editing
+a field, to move on to the next button or field.  To insert a newline
+within an editable field, use @kbd{C-o} or @kbd{C-q C-j}.
 
 @cindex saving a setting
 @cindex settings, how to save
@@ -508,16 +502,17 @@ are hidden, nor on subgroups which are hidden or not visible in the buffer.
 @node Saving Customizations
 @subsection Saving Customizations
 
+@vindex custom-file
   Saving customizations from the customization buffer works by writing
-code that future sessions will read, code to set up those
-customizations again.
+code to a file.  By reading this code, future sessions can set up the
+customizations again.  Normally, the code is saved in your
+initialization file (@pxref{Init File}).
 
-@vindex custom-file
-  Normally this saves customizations in your init file,
-@file{~/.emacs}.  If you wish, you can save customizations in another
-file instead.  To make this work, your @file{~/.emacs} should set
-@code{custom-file} to the name of that file.  Then you should load the
-file by calling @code{load}.  For example:
+  You can choose to save your customizations in a file other than your
+initialization file.  To make this work, you must add a couple of
+lines of code to your initialization file, to set the variable
+@code{custom-file} to the name of the desired file, and to load that
+file.  For example:
 
 @example
 (setq custom-file "~/.emacs-custom.el")
@@ -528,27 +523,24 @@ file by calling @code{load}.  For example:
 files for different Emacs versions, like this:
 
 @example
-(cond ((< emacs-major-version 21)
-       ;; @r{Emacs 20 customization.}
-       (setq custom-file "~/.custom-20.el"))
-      ((and (= emacs-major-version 21) (< emacs-minor-version 4))
-       ;; @r{Emacs 21 customization, before version 21.4.}
+(cond ((< emacs-major-version 22)
+       ;; @r{Emacs 21 customization.}
        (setq custom-file "~/.custom-21.el"))
-      ((< emacs-major-version 22)
-       ;; @r{Emacs version 21.4 or later.}
-       (setq custom-file "~/.custom-21.4.el"))
+      ((and (= emacs-major-version 22) (< emacs-minor-version 3))
+       ;; @r{Emacs 22 customization, before version 22.3.}
+       (setq custom-file "~/.custom-22.el"))
       (t
-       ;; @r{Emacs version 22.1 or later.}
-       (setq custom-file "~/.custom-22.el")))
+       ;; @r{Emacs version 22.3 or later.}
+       (setq custom-file "~/.emacs-custom.el")))
 
 (load custom-file)
 @end example
 
   If Emacs was invoked with the @option{-q} or @option{--no-init-file}
 options (@pxref{Initial Options}), it will not let you save your
-customizations in your @file{~/.emacs} init file.  This is because
-saving customizations from such a session would wipe out all the other
-customizations you might have on your init file.
+customizations in your initialization file.  This is because saving
+customizations from such a session would wipe out all the other
+customizations you might have on your initialization file.
 
 @node Face Customization
 @subsection Customizing Faces
@@ -763,32 +755,42 @@ enables the theme.)
 @cindex user option
 
   A @dfn{variable} is a Lisp symbol which has a value.  The symbol's
-name is also called the name of the variable.  A variable name can
-contain any characters that can appear in a file, but conventionally
-variable names consist of words separated by hyphens.  A variable can
-have a documentation string which describes what kind of value it should
-have and how the value will be used.
+name is also called the @dfn{variable name}.  A variable name can
+contain any characters that can appear in a file, but most variable
+names consist of ordinary words separated by hyphens.
 
-  Emacs Lisp allows any variable (with a few exceptions) to have any
-kind of value, but most variables that Emacs uses expect a value of a
-certain type.  Often the value should always be a string, or should
-always be a number.  Sometimes we say that a certain feature is turned
-on if a variable is ``non-@code{nil},'' meaning that if the variable's
-value is @code{nil}, the feature is off, but the feature is on for
-@emph{any} other value.  The conventional value to use to turn on the
-feature---since you have to pick one particular value when you set the
-variable---is @code{t}.
+  The name of the variable serves as a compact description of its
+role.  Most variables also have a @dfn{documentation string}, which
+describes what the variable's purpose is, what kind of value it should
+have, and how the value will be used.  You can view this documentation
+using the help command @kbd{C-h v} (@code{describe-variable}).
+@xref{Examining}.
 
   Emacs uses many Lisp variables for internal record keeping, but the
 most interesting variables for a non-programmer user are those meant
-for users to change---these are called @dfn{user options}.
+for users to change---these are called @dfn{user options}.  @xref{Easy
+Customization}, for information about using the Customize facility to
+set user options.  In the following sections, we describe will other
+aspects of Emacs variables, such as how to set them outside Customize.
 
-  Each user option that you can set with the customization buffer is
-in fact a Lisp variable.  Emacs does not (usually) change the values
-of these variables on its own; instead, you set the values in order to
-control the behavior of certain Emacs commands.  Use of the
-customization buffer is explained above (@pxref{Easy Customization});
-here we describe other aspects of Emacs variables.
+  Emacs Lisp allows any variable (with a few exceptions) to have any
+kind of value.  However, many variables are meaningful only if
+assigned values of a certain type.  For example, only numbers are
+meaningful values for @code{kill-ring-max}, which specifies the
+maximum length of the kill ring (@pxref{Earlier Kills}); if you give
+@code{kill-ring-max} a string value, commands such as @kbd{C-y}
+(@code{yank}) will signal an error.  On the other hand, some variables
+don't care about type; for instance, if a variable has one effect for
+@code{nil} values and another effect for ``non-@code{nil}'' values,
+then any value that is not the symbol @code{nil} induces the second
+effect, regardless of its type (by convention, we usually use the
+value @code{t}---a symbol which stands for ``true''---to specify a
+non-@code{nil} value).  If you set a variable using the customization
+buffer, you need not worry about giving it an invalid type: the
+customization buffer usually only allows you to enter meaningful
+values.  When in doubt, use @kbd{C-h v} (@code{describe-variable}) to
+check the variable's documentation string to see kind of value it
+expects (@pxref{Examining}).
 
 @menu
 * Examining::          Examining or setting one variable's value.
@@ -796,6 +798,7 @@ here we describe other aspects of Emacs variables.
                          of Emacs to run on particular occasions.
 * Locals::             Per-buffer values of variables.
 * File Variables::      How files can specify variable values.
+* Directory Variables:: How variable values can be specified by directory.
 @end menu
 
 @node Examining
@@ -828,8 +831,9 @@ fill-column's value is 70
 Local in buffer custom.texi; global value is 70
 Automatically becomes buffer-local when set in any fashion.
 
-This variable is safe to use as a file local variable only if its value
-satisfies the predicate `integerp'.
+  Automatically becomes buffer-local when set in any fashion.
+  This variable is safe as a file local variable if its value
+  satisfies the predicate `integerp'.
 
 Documentation:
 *Column beyond which automatic line-wrapping should happen.
@@ -839,14 +843,13 @@ You can customize this variable.
 @end smallexample
 
 @noindent
-The line that says you can customize the variable indicates that this
-variable is a user option.  (The star also indicates this, but it is
-an obsolete indicator that may eventually disappear.)  @kbd{C-h v} is
-not restricted to user options; it allows any variable name.
+The line that says ``You can customize the variable'' indicates that
+this variable is a user option.  @kbd{C-h v} is not restricted to user
+options; it allows any variable name.
 
 @findex set-variable
-The most convenient way to set a specific user option variable is with
-@kbd{M-x set-variable}.  This reads the variable name with the
+  The most convenient way to set a specific user option variable is
+with @kbd{M-x set-variable}.  This reads the variable name with the
 minibuffer (with completion), and then reads a Lisp expression for the
 new value using the minibuffer a second time (you can insert the old
 value into the minibuffer for editing via @kbd{M-n}).  For example,
@@ -873,27 +876,28 @@ Interaction}.
   Setting variables, like all means of customizing Emacs except where
 otherwise stated, affects only the current Emacs session.  The only
 way to alter the variable in future sessions is to put something in
-the @file{~/.emacs} file to set it those sessions (@pxref{Init File}).
+your initialization file to set it those sessions (@pxref{Init File}).
 
 @node Hooks
 @subsection Hooks
 @cindex hook
 @cindex running a hook
 
-  @dfn{Hooks} are an important mechanism for customization of Emacs.  A
-hook is a Lisp variable which holds a list of functions, to be called on
-some well-defined occasion.  (This is called @dfn{running the hook}.)
-The individual functions in the list are called the @dfn{hook functions}
-of the hook.  With rare exceptions, hooks in Emacs are empty when Emacs
-starts up, so the only hook functions in any given hook are the ones you
-explicitly put there as customization.
-
-  Most major modes run one or more @dfn{mode hooks} as the last step of
-initialization.  This makes it easy for you to customize the behavior of
-the mode, by setting up a hook function to override the local variable
-assignments already made by the mode.  But hooks are also used in other
-contexts.  For example, the hook @code{suspend-hook} runs just before
-Emacs suspends itself (@pxref{Exiting}).
+  @dfn{Hooks} are an important mechanism for customizing Emacs.  A
+hook is a Lisp variable which holds a list of functions, to be called
+on some well-defined occasion.  (This is called @dfn{running the
+hook}.)  The individual functions in the list are called the @dfn{hook
+functions} of the hook.  With rare exceptions, hooks in Emacs are
+empty when Emacs starts up, so the only hook functions in any given
+hook are the ones you explicitly put there as customization.
+
+  Most major modes run one or more @dfn{mode hooks} as the last step
+of initialization.  This makes it easy for you to customize the
+behavior of the mode, by setting up a hook function to override the
+local variable assignments already made by the mode.  But hooks are
+also used in other contexts.  For example, the hook
+@code{kill-emacs-hook} runs just before quitting the Emacs job
+(@pxref{Exiting}).
 
 @cindex normal hook
   Most Emacs hooks are @dfn{normal hooks}.  This means that running the
@@ -1108,41 +1112,37 @@ The same is true for man pages which start with the magic string
 @samp{'\"} to specify a list of troff preprocessors (not all do,
 however).
 
-  A @dfn{local variables list} goes near the end of the file, in the
-last page.  (It is often best to put it on a page by itself.)  The local
-variables list starts with a line containing the string @samp{Local
-Variables:}, and ends with a line containing the string @samp{End:}.  In
-between come the variable names and values, one set per line, as
+  A @dfn{local variables list} goes near the end of the file.  It
+starts with a line containing the string @samp{Local Variables:}, and
+ends with a line containing the string @samp{End:}.  In between come
+the variable names and values, one set per line, as
 @samp{@var{variable}:@: @var{value}}.  The @var{value}s are not
 evaluated; they are used literally.  If a file has both a local
-variables list and a @samp{-*-} line, Emacs processes @emph{everything}
-in the @samp{-*-} line first, and @emph{everything} in the local
-variables list afterward.
+variables list and a @samp{-*-} line, Emacs processes
+@emph{everything} in the @samp{-*-} line first, and @emph{everything}
+in the local variables list afterward.
 
   Here is an example of a local variables list:
 
 @example
-;; Local Variables: **
-;; mode:lisp **
-;; comment-column:0 **
-;; comment-start: ";; "  **
-;; comment-end:"**" **
-;; End: **
+/* Local Variables: */
+/* mode:c           */
+/* comment-column:0 */
+/* End:             */
 @end example
 
-  Each line starts with the prefix @samp{;; } and each line ends with
-the suffix @samp{ **}.  Emacs recognizes these as the prefix and
-suffix based on the first line of the list, by finding them
-surrounding the magic string @samp{Local Variables:}; then it
+  In this example, each line starts with the prefix @samp{/*} and each
+line ends with the suffix @samp{*/}.  Emacs recognizes these as the
+prefix and suffix by finding them surrounding the magic string
+@samp{Local Variables:}, on the first line of the list; it then
 automatically discards them from the other lines of the list.
 
   The usual reason for using a prefix and/or suffix is to embed the
 local variables list in a comment, so it won't confuse other programs
-that the file is intended as input for.  The example above is for a
-language where comment lines start with @samp{;; } and end with
-@samp{**}; the local values for @code{comment-start} and
-@code{comment-end} customize the rest of Emacs for this unusual
-syntax.  Don't use a prefix (or a suffix) if you don't need one.
+that the file is intended as input for.  The example above is for the
+C programming language, where comment lines start with @samp{/*} and
+end with @samp{*/}.  Don't use a prefix (or a suffix) if you don't
+need one.
 
   If you write a multi-line string value, you should put the prefix
 and suffix on each line, even lines that start or end within the
@@ -1188,12 +1188,10 @@ alone (@pxref{Init File}).  Don't use a local variable list to impose
 your taste on everyone.
 
   The start of the local variables list must be no more than 3000
-characters from the end of the file, and must be in the last page if the
-file is divided into pages.  Otherwise, Emacs will not notice it is
-there.  The purpose of this rule is so that a stray @samp{Local
-Variables:}@: not in the last page does not confuse Emacs, and so that
-visiting a long file that is all one page and has no local variables
-list need not take the time to search the whole file.
+characters from the end of the file, and must be in the last page if
+the file is divided into pages.  Otherwise, Emacs will not notice it
+is there.  The purpose of this rule is so that Emacs need not take the
+time to search the whole file.
 
   Use the command @code{normal-mode} to reset the local variables and
 major mode of a buffer according to the file name and contents,
@@ -1262,6 +1260,86 @@ customizable list of eval forms which are safe.  Emacs does not ask
 for confirmation when it finds these forms for the @code{eval}
 variable.
 
+@node Directory Variables
+@subsection Per-Directory Local Variables
+@cindex local variables, for all files in a directory
+@cindex directory local variables
+@cindex per-directory local variables
+
+  A @dfn{project} is a collection of files on which you work together.
+Usually, the project's files are kept in one or more directories.
+Occasionally, you may wish to define Emacs settings that are common to
+all the files that belong to the project.
+
+  Emacs provides two ways to specify settings that are applicable to
+files in a specific directory: you can put a special file in that
+directory, or you can define a @dfn{project class} for that directory.
+
+@cindex @file{.dir-locals.el} file
+  If you put a file with a special name @file{.dir-locals.el}@footnote{
+On MS-DOS, the name of this file should be @file{_dir-locals.el}, due
+to limitations of the DOS filesystems.  If the filesystem is limited
+to 8+3 file names, the name of the file will be truncated by the OS to
+@file{_dir-loc.el}.
+} in a directory, Emacs will read it when it visits any file in that
+directory or any of its subdirectories, and apply the settings it
+specifies to the file's buffer.  Emacs searches for
+@file{.dir-locals.el} starting in the directory of the visited file,
+and moving up the directory tree.  (To avoid slowdown, this search is
+skipped for remote files.)
+
+  The @file{.dir-locals.el} file should hold a specially-constructed
+list.  This list maps Emacs mode names (symbols) to alists; each alist
+specifies values for variables to use when the respective mode is
+turned on.  The special mode name @samp{nil} means that its alist
+applies to any mode.  Instead of a mode name, you can specify a string
+that is a name of a subdirectory of the project's directory; then the
+corresponding alist applies to all the files in that subdirectory.
+
+  Here's an example of a @file{.dir-locals.el} file:
+
+@example
+((nil . ((indent-tabs-mode . t)
+         (tab-width . 4)
+         (fill-column . 80)))
+ (c-mode . ((c-file-style . "BSD")))
+ (java-mode . ((c-file-style . "BSD")))
+ ("src/imported"
+  . ((nil . ((change-log-default-name . "ChangeLog.local"))))))
+@end example
+
+@noindent
+This example shows some settings for a hypothetical project.  It sets
+@samp{indent-tabs-mode}, @code{tab-width}, and @code{fill-column} for
+any file in the project's directory tree, and it sets the indentation
+style for any C or Java source file.  Finally, it specifies a different
+@file{ChangeLog} file name for any file in the @file{src/imported}
+subdirectory of the directory where you put the @file{.dir-locals.el}
+file.
+
+@findex dir-locals-set-class-variables
+@findex dir-locals-set-directory-class
+  Another method of specifying directory-local variables is to explicitly
+define a project class using @code{dir-locals-set-class-variables}, and
+then tell Emacs which directories correspond to that class, using
+@code{dir-locals-set-directory-class}.  You can put calls to these functions
+in your @file{~/.emacs} init file; this can be useful when you can't put
+@file{.dir-locals.el} in the directory for some reason, or if you want
+to keep in a single place settings for several directories that don't
+have a common parent.  For example, you could apply settings to an
+unwritable directory this way:
+
+@example
+(dir-locals-set-class-variables 'unwritable-directory
+   '((nil . ((some-useful-setting . value)))))
+
+(dir-locals-set-directory-class
+   "/usr/include/" 'unwritable-directory)
+@end example
+
+  Unsafe directory-local variables are handled in the same way as
+unsafe file-local variables (@pxref{Safe File Variables}).
+
 @node Key Bindings
 @section Customizing Key Bindings
 @cindex key bindings
@@ -1281,6 +1359,7 @@ name, which usually consists of lower-case letters and hyphens.
 * Minibuffer Maps::     The minibuffer uses its own local keymaps.
 * Rebinding::           How to redefine one key's meaning conveniently.
 * Init Rebinding::      Rebinding keys with your init file, @file{.emacs}.
+* Modifier Keys::       Using modifier keys in key bindings.
 * Function Keys::       Rebinding terminal function keys.
 * Named ASCII Chars::   Distinguishing @key{TAB} from @kbd{C-i}, and so on.
 * Mouse Buttons::       Rebinding mouse buttons in Emacs.
@@ -1297,12 +1376,12 @@ name, which usually consists of lower-case letters and hyphens.
 in data structures called @dfn{keymaps}.  Emacs has many of these, each
 used on particular occasions.
 
-  Recall that a @dfn{key sequence} (@dfn{key}, for short) is a sequence
-of @dfn{input events} that have a meaning as a unit.  Input events
+  A @dfn{key sequence} (@dfn{key}, for short) is a sequence of
+@dfn{input events} that have a meaning as a unit.  Input events
 include characters, function keys and mouse buttons---all the inputs
 that you can send to the computer with your terminal.  A key sequence
 gets its meaning from its @dfn{binding}, which says what command it
-runs.  The function of keymaps is to record these bindings.
+runs.  The role of keymaps is to record these bindings.
 
 @cindex global keymap
   The @dfn{global} keymap is the most important keymap because it is
@@ -1319,48 +1398,26 @@ Commands to rebind keys, such as @kbd{M-x global-set-key}, actually work
 by storing the new binding in the proper place in the global map.
 @xref{Rebinding}.
 
-   Meta characters work differently; Emacs translates each Meta
-character into a pair of characters starting with @key{ESC}.  When you
-type the character @kbd{M-a} in a key sequence, Emacs replaces it with
-@kbd{@key{ESC} a}.  A meta key comes in as a single input event, but
-becomes two events for purposes of key bindings.  The reason for this is
-historical, and we might change it someday.
-
 @cindex function key
   Most modern keyboards have function keys as well as character keys.
 Function keys send input events just as character keys do, and keymaps
-can have bindings for them.
-
-  On text terminals, typing a function key actually sends the computer a
-sequence of characters; the precise details of the sequence depends on
-which function key and on the model of terminal you are using.  (Often
-the sequence starts with @kbd{@key{ESC} [}.)  If Emacs understands your
-terminal type properly, it recognizes the character sequences forming
-function keys wherever they occur in a key sequence (not just at the
-beginning).  Thus, for most purposes, you can pretend the function keys
-reach Emacs directly and ignore their encoding as character sequences.
-
-@cindex mouse
-  Mouse buttons also produce input events.  These events come with other
-data---the window and position where you pressed or released the button,
-and a time stamp.  But only the choice of button matters for key
-bindings; the other data matters only if a command looks at it.
-(Commands designed for mouse invocation usually do look at the other
-data.)
-
-  A keymap records definitions for single events.  Interpreting a key
-sequence of multiple events involves a chain of keymaps.  The first
-keymap gives a definition for the first event; this definition is
-another keymap, which is used to look up the second event in the
-sequence, and so on.
-
-  Key sequences can mix function keys and characters.  For example,
-@kbd{C-x @key{SELECT}} is meaningful.  If you make @key{SELECT} a prefix
-key, then @kbd{@key{SELECT} C-n} makes sense.  You can even mix mouse
-events with keyboard events, but we recommend against it, because such
-key sequences are inconvenient to use.
-
-  As a user, you can redefine any key; but it is usually best to stick
+can have bindings for them.  On text terminals, typing a function key
+actually sends the computer a sequence of characters; the precise
+details of the sequence depends on which function key and on the model
+of terminal you are using.  (Often the sequence starts with
+@kbd{@key{ESC} [}.)  If Emacs understands your terminal type properly,
+it recognizes the character sequences forming function keys wherever
+they occur in a key sequence.  Thus, for most purposes, you can
+pretend the function keys reach Emacs directly and ignore their
+encoding as character sequences.
+
+  Key sequences can mix function keys and characters.  For example, if
+your keyboard has a @key{Home} function key, Emacs also recognizes key
+sequences like @kbd{C-x @key{Home}}.  You can even mix mouse events
+with keyboard events, but we recommend against it, because such key
+sequences are inconvenient to use.
+
+  As a user, you can redefine any key, but it is usually best to stick
 to key sequences that consist of @kbd{C-c} followed by a letter (upper
 or lower case).  These keys are ``reserved for users,'' so they won't
 conflict with any properly designed Emacs extension.  The function
@@ -1371,9 +1428,13 @@ extensions or major modes which redefine the same key.
 @node Prefix Keymaps
 @subsection Prefix Keymaps
 
-  A prefix key such as @kbd{C-x} or @key{ESC} has its own keymap,
-which holds the definition for the event that immediately follows
-that prefix.
+  Internally, Emacs records only single events in each keymap.
+Interpreting a key sequence of multiple events involves a chain of
+keymaps: the first keymap gives a definition for the first event,
+which is another keymap, which is used to look up the second event in
+the sequence, and so on.  Thus, a prefix key such as @kbd{C-x} or
+@key{ESC} has its own keymap, which holds the definition for the event
+that immediately follows that prefix.
 
   The definition of a prefix key is usually the keymap to use for
 looking up the following event.  The definition can also be a Lisp
@@ -1567,11 +1628,6 @@ M-x global-set-key @key{RET} C-x 4 $ spell-other-window @key{RET}
 redefines @kbd{C-x 4 $} to run the (fictitious) command
 @code{spell-other-window}.
 
-  The two-character keys consisting of @kbd{C-c} followed by a letter
-are reserved for user customizations.  Lisp programs are not supposed to
-define these keys, so the bindings you make for them will be available
-in all major modes and will never get in the way of anything.
-
   You can remove the global definition of a key with
 @code{global-unset-key}.  This makes the key @dfn{undefined}; if you
 type it, Emacs will just beep.  Similarly, @code{local-unset-key} makes
@@ -1596,67 +1652,68 @@ command is less work to invoke when you really want to.
 @c it, the tutorial needs to be adjusted.  (TUTORIAL.de)
 
   If you have a set of key bindings that you like to use all the time,
-you can specify them in your @file{.emacs} file by using their Lisp
-syntax.  (@xref{Init File}.)
+you can specify them in your initialization file by writing Lisp code
+(@pxref{Init File}).
 
-  The simplest method for doing this works for @acronym{ASCII} characters and
-Meta-modified @acronym{ASCII} characters only.  This method uses a string to
-represent the key sequence you want to rebind.  For example, here's how
-to bind @kbd{C-z} to @code{shell}:
+@findex kbd
+  There are several ways to write a key binding using Lisp.  The
+simplest is to use the @code{kbd} macro, which converts a textual
+representation of a key sequence---similar to how we have written key
+sequences in this manual---into a form that can be passed as an
+argument to @code{global-set-key}.  For example, here's how to bind
+@kbd{C-z} to @code{shell} (@pxref{Interactive Shell}):
 
 @example
-(global-set-key "\C-z" 'shell)
+(global-set-key (kbd "C-z") 'shell)
 @end example
 
 @noindent
-This example uses a string constant containing one character,
-@kbd{C-z}.  (@samp{\C-} is string syntax for a control character.)  The
-single-quote before the command name, @code{shell}, marks it as a
+The single-quote before the command name, @code{shell}, marks it as a
 constant symbol rather than a variable.  If you omit the quote, Emacs
-would try to evaluate @code{shell} immediately as a variable.  This
-probably causes an error; it certainly isn't what you want.
+would try to evaluate @code{shell} as a variable.  This probably
+causes an error; it certainly isn't what you want.
 
-  Here is another example that binds the key sequence @kbd{C-x M-l}:
+  Here are some additional examples, including binding function keys
+and mouse events:
 
 @example
-(global-set-key "\C-x\M-l" 'make-symbolic-link)
+(global-set-key (kbd "C-c y") 'clipboard-yank)
+(global-set-key (kbd "C-M-q") 'query-replace)
+(global-set-key (kbd "<f5>") 'flyspell-mode)
+(global-set-key (kbd "C-<f5>") 'linum-mode)
+(global-set-key (kbd "C-<right>") 'forward-sentence)
+(global-set-key (kbd "<mouse-2>") 'mouse-save-then-kill)
+(global-set-key (kbd "C-<down-mouse-3>") 'mouse-yank-at-click)
 @end example
 
-  To put @key{TAB}, @key{RET}, @key{ESC}, or @key{DEL} in the
-string, you can use the Emacs Lisp escape sequences, @samp{\t},
-@samp{\r}, @samp{\e}, and @samp{\d}.  Here is an example which binds
-@kbd{C-x @key{TAB}}:
+  Instead of using the @code{kbd} macro, you can use a Lisp string or
+vector to specify the key sequence.  Using a string is simpler, but
+only works for @acronym{ASCII} characters and Meta-modified
+@acronym{ASCII} characters.  For example, here's how to bind @kbd{C-x
+M-l} to @code{make-symbolic-link} (@pxref{Misc File Ops}):
 
 @example
-(global-set-key "\C-x\t" 'indent-rigidly)
+(global-set-key "\C-x\M-l" 'make-symbolic-link)
 @end example
 
-  These examples show how to write some other special @acronym{ASCII} characters
-in strings for key bindings:
+  To put @key{TAB}, @key{RET}, @key{ESC}, or @key{DEL} in the string,
+use the Emacs Lisp escape sequences @samp{\t}, @samp{\r}, @samp{\e},
+and @samp{\d} respectively.  Here is an example which binds @kbd{C-x
+@key{TAB}} to @code{indent-rigidly} (@pxref{Indentation}):
 
 @example
-(global-set-key "\r" 'newline)               ;; @key{RET}
-(global-set-key "\d" 'delete-backward-char)  ;; @key{DEL}
-(global-set-key "\C-x\e\e" 'repeat-complex-command)  ;; @key{ESC}
+(global-set-key "\C-x\t" 'indent-rigidly)
 @end example
 
   When the key sequence includes function keys or mouse button events,
-or non-@acronym{ASCII} characters such as @code{C-=} or @code{H-a}, you must use
-the more general method of rebinding, which uses a vector to specify the
-key sequence.
-
-  The way to write a vector in Emacs Lisp is with square brackets around
-the vector elements.  Use spaces to separate the elements.  If an
-element is a symbol, simply write the symbol's name---no other
-delimiters or punctuation are needed.  If a vector element is a
-character, write it as a Lisp character constant: @samp{?} followed by
-the character as it would appear in a string.
-
-  Here are examples of using vectors to rebind @kbd{C-=} (a control
-character not in @acronym{ASCII}), @kbd{C-M-=} (not in @acronym{ASCII} because @kbd{C-=}
-is not), @kbd{H-a} (a Hyper character; @acronym{ASCII} doesn't have Hyper at
-all), @key{F7} (a function key), and @kbd{C-Mouse-1} (a
-keyboard-modified mouse button):
+or non-@acronym{ASCII} characters such as @code{C-=} or @code{H-a},
+you must use a vector to specify the key sequence.  Each element in
+the vector stands for an input event; the elements are separated by
+spaces and surrounded by a pair of square brackets.  If an element is
+a symbol, simply write the symbol's name---no other delimiters or
+punctuation are needed.  If a vector element is a character, write it
+as a Lisp character constant: @samp{?} followed by the character as it
+would appear in a string.  Here are some examples:
 
 @example
 (global-set-key [?\C-=] 'make-symbolic-link)
@@ -1666,25 +1723,53 @@ keyboard-modified mouse button):
 (global-set-key [C-mouse-1] 'make-symbolic-link)
 @end example
 
-  You can use a vector for the simple cases too.  Here's how to
-rewrite the first six examples above to use vectors:
+@noindent
+You can use a vector for the simple cases too:
 
 @example
-(global-set-key [?\C-z] 'shell)
-(global-set-key [?\C-x ?l] 'make-symbolic-link)
-(global-set-key [?\C-x ?\t] 'indent-rigidly)
-(global-set-key [?\r] 'newline)
-(global-set-key [?\d] 'delete-backward-char)
-(global-set-key [?\C-x ?\e ?\e] 'repeat-complex-command)
+(global-set-key [?\C-z ?\M-l] 'make-symbolic-link)
 @end example
 
-@noindent
-As you see, you represent a multi-character key sequence with a vector
-by listing all of the characters, in order, within the square brackets
-that delimit the vector.
-
-  Language and coding systems can cause problems with key bindings
-for non-@acronym{ASCII} characters.  @xref{Init Non-ASCII}.
+  Language and coding systems may cause problems with key bindings for
+non-@acronym{ASCII} characters.  @xref{Init Non-ASCII}.
+
+@node Modifier Keys
+@subsection Modifier Keys
+@cindex modifier keys
+
+  The default key bindings in Emacs are set up so that modified
+alphabetical characters are case-insensitive.  In other words,
+@kbd{C-A} does the same thing as @kbd{C-a}, and @kbd{M-A} does the
+same thing as @kbd{M-a}.  This concerns only alphabetical characters,
+and does not apply to ``shifted'' versions of other keys; for
+instance, @kbd{C-@@} is not the same as @kbd{C-2}.
+
+  When you customize Emacs, you can make modified alphabetical
+characters case-sensitive.  For instance, you could make @kbd{M-a} and
+@kbd{M-A} run different commands.
+
+  As a special exception, a @key{Control}-modified alphabetical
+character is always case-insensitive, for historical reasons: Emacs
+always treats @kbd{C-A} as @kbd{C-a}, @kbd{C-B} as @kbd{C-b}, and so
+forth.
+
+  Although only the @key{Control} and @key{Meta} modifier keys are
+commonly used, Emacs supports three other modifier keys.  These are
+called @key{Super}, @key{Hyper} and @key{Alt}.  Few terminals provide
+ways to use these modifiers; the key labeled @key{Alt} on most
+keyboards usually issues the @key{Meta} modifier, not @key{Alt}.  The
+standard key bindings in Emacs do not include any characters with
+these modifiers.  However, you can customize Emacs to assign meanings
+to them.  The modifier bits are labelled as @samp{s-}, @samp{H-} and
+@samp{A-} respectively.
+
+  Even if your keyboard lacks these additional modifier keys, you can
+enter it using @kbd{C-x @@}: @kbd{C-x @@ h} adds the ``hyper'' flag to
+the next character, @kbd{C-x @@ s} adds the ``super'' flag, and
+@kbd{C-x @@ a} adds the ``alt'' flag.  For instance, @kbd{C-x @@ h
+C-a} is a way to enter @kbd{Hyper-Control-a}.  (Unfortunately, there
+is no way to add two modifiers by using @kbd{C-x @@} twice for the
+same character, because the first one goes to work on the @kbd{C-x}.)
 
 @node Function Keys
 @subsection Rebinding Function Keys
@@ -1728,52 +1813,7 @@ X) may use different names.  To make certain what symbol is used for a
 given function key on your terminal, type @kbd{C-h c} followed by that
 key.
 
-  A key sequence which contains function key symbols (or anything but
-@acronym{ASCII} characters) must be a vector rather than a string.
-Thus, to bind function key @samp{f1} to the command @code{rmail},
-write the following:
-
-@example
-(global-set-key [f1] 'rmail)
-@end example
-
-@noindent
-To bind the right-arrow key to the command @code{forward-char}, you can
-use this expression:
-
-@example
-(global-set-key [right] 'forward-char)
-@end example
-
-@noindent
-This uses the Lisp syntax for a vector containing the symbol
-@code{right}.  (This binding is present in Emacs by default.)
-
-  @xref{Init Rebinding}, for more information about using vectors for
-rebinding.
-
-  You can mix function keys and characters in a key sequence.  This
-example binds @kbd{C-x @key{NEXT}} to the command @code{forward-page}.
-
-@example
-(global-set-key [?\C-x next] 'forward-page)
-@end example
-
-@noindent
-where @code{?\C-x} is the Lisp character constant for the character
-@kbd{C-x}.  The vector element @code{next} is a symbol and therefore
-does not take a question mark.
-
-  You can use the modifier keys @key{CTRL}, @key{META}, @key{HYPER},
-@key{SUPER}, @key{ALT} and @key{SHIFT} with function keys.  To represent
-these modifiers, add the strings @samp{C-}, @samp{M-}, @samp{H-},
-@samp{s-}, @samp{A-} and @samp{S-} at the front of the symbol name.
-Thus, here is how to make @kbd{Hyper-Meta-@key{RIGHT}} move forward a
-word:
-
-@example
-(global-set-key [H-M-right] 'forward-word)
-@end example
+  @xref{Init Rebinding}, for examples of binding function keys.
 
 @cindex keypad
   Many keyboards have a ``numeric keypad'' on the right hand side.
@@ -1786,7 +1826,10 @@ the numeric keypad produces @code{kp-8}, which is translated to
 @code{kp-up}, which is translated to @key{UP}.  If you rebind a key
 such as @kbd{8} or @key{UP}, it affects the equivalent keypad key too.
 However, if you rebind a @samp{kp-} key directly, that won't affect
-its non-keypad equivalent.
+its non-keypad equivalent.  Note that the modified keys are not
+translated: for instance, if you hold down the @key{META} key while
+pressing the @samp{8} key on the numeric keypad, that generates
+@kbd{M-@key{kp-8}}.
 
   Emacs provides a convenient method for binding the numeric keypad
 keys, using the variables @code{keypad-setup},
@@ -1805,8 +1848,8 @@ used so often that they have special keys of their own.  For instance,
 @key{TAB} was another name for @kbd{C-i}.  Later, users found it
 convenient to distinguish in Emacs between these keys and the ``same''
 control characters typed with the @key{CTRL} key.  Therefore, on most
-modern terminals, they are no longer the same, and @key{TAB} is
-distinguishable from @kbd{C-i}.
+modern terminals, they are no longer the same: @key{TAB} is different
+from @kbd{C-i}.
 
   Emacs can distinguish these two kinds of input if the keyboard does.
 It treats the ``special'' keys as function keys named @code{tab},
@@ -2047,16 +2090,17 @@ Reference Manual}.
 @cindex rebinding keys, permanently
 @cindex startup (init file)
 
-  When Emacs is started, it normally loads a Lisp program from the file
-@file{.emacs} or @file{.emacs.el} in your home directory (@pxref{Find Init}).
-We call this file your @dfn{init file} because it specifies how to
-initialize Emacs for you.  You can use the command line switch
-@samp{-q} to prevent loading your init file, and @samp{-u} (or
-@samp{--user}) to specify a different user's init file (@pxref{Initial
-Options}).
+  When Emacs is started, it normally tries to load a Lisp program from
+an @dfn{initialization file}, or @dfn{init file} for short.  This
+file, if it exists, specifies how to initialize Emacs for you.  Emacs
+looks for your init file using the filenames @file{~/.emacs},
+@file{~/.emacs.el}, or @file{~/.emacs.d/init.el}; you can choose to
+use any one of these three names (@pxref{Find Init}).  Here, @file{~/}
+stands for your home directory.
 
-  You can also use @file{~/.emacs.d/init.el} as the init file.  Emacs
-tries this if it cannot find @file{~/.emacs} or @file{~/.emacs.el}.
+  You can use the command line switch @samp{-q} to prevent loading
+your init file, and @samp{-u} (or @samp{--user}) to specify a
+different user's init file (@pxref{Initial Options}).
 
 @cindex @file{default.el}, the default init file
   There can also be a @dfn{default init file}, which is the library
@@ -2087,14 +2131,14 @@ Many sites put these files in the @file{site-lisp} subdirectory of the
 Emacs installation directory, typically
 @file{/usr/local/share/emacs/site-lisp}.
 
-  Byte-compiling your @file{.emacs} is not recommended (@pxref{Byte
+  Byte-compiling your init file is not recommended (@pxref{Byte
 Compilation,, Byte Compilation, elisp, the Emacs Lisp Reference
 Manual}).  It generally does not speed up startup very much, and often
 leads to problems when you forget to recompile the file.  A better
 solution is to use the Emacs server to reduce the number of times you
-have to start Emacs (@pxref{Emacs Server}).  If your @file{.emacs}
-defines many functions, consider moving them to a separate
-(byte-compiled) file that you load in your @file{.emacs}.
+have to start Emacs (@pxref{Emacs Server}).  If your init file defines
+many functions, consider moving them to a separate (byte-compiled)
+file that you load in your init file.
 
   If you are going to write actual Emacs Lisp programs that go beyond
 minor customization, you should read the @cite{Emacs Lisp Reference Manual}.
@@ -2114,11 +2158,11 @@ Manual}.
 @node Init Syntax
 @subsection Init File Syntax
 
-  The @file{.emacs} file contains one or more Lisp function call
-expressions.  Each of these consists of a function name followed by
-arguments, all surrounded by parentheses.  For example, @code{(setq
-fill-column 60)} calls the function @code{setq} to set the variable
-@code{fill-column} (@pxref{Filling}) to 60.
+  The init file contains one or more Lisp expressions.  Each of these
+consists of a function name followed by arguments, all surrounded by
+parentheses.  For example, @code{(setq fill-column 60)} calls the
+function @code{setq} to set the variable @code{fill-column}
+(@pxref{Filling}) to 60.
 
   You can set any Lisp variable with @code{setq}, but with certain
 variables @code{setq} won't do what you probably want in the