]> code.delx.au - gnu-emacs/blobdiff - man/custom.texi
Simplify the reference to Octave mode.
[gnu-emacs] / man / custom.texi
index 8eb991fbed79b7773698774172c4e621faf67d35..6fbe69efb87ec9c0aa806945b2de36cf24dcd544 100644 (file)
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985, 86, 87, 93, 94, 95, 97, 2000
+@c Copyright (C) 1985,86,87,93,94,95,97,2000,2001,2002
 @c  Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Customization, Quitting, Amusements, Top
@@ -8,7 +8,8 @@
 
   This chapter talks about various topics relevant to adapting the
 behavior of Emacs in minor ways.  See @cite{The Emacs Lisp Reference
-Manual} for how to make more far-reaching changes.
+Manual} for how to make more far-reaching 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
@@ -83,8 +84,8 @@ preference---other users editing the same file might not want the same
 minor modes you prefer.
 
   The buffer-local minor modes include Abbrev mode, Auto Fill mode,
-Auto Save mode, Font-Lock mode, ISO Accents mode, Outline minor mode,
-Overwrite mode, and Binary Overwrite mode.
+Auto Save mode, Font-Lock mode, Glasses mode, ISO Accents 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
@@ -284,12 +285,12 @@ otherwise stated, affects only the current Emacs session.
 @findex customize
 @cindex customization buffer
   A convenient way to find the user option variables that you want to
-change, and then change them, is with @kbd{M-x customize}.  This command
-creates a @dfn{customization buffer} with which you can browse through
-the Emacs user options in a logically organized structure, then edit and
-set their values.  You can also use the customization buffer to save
-settings permanently.  (Not all Emacs user options are included in this
-structure as of yet, but we are adding the rest.)
+change, and then change them, is with @kbd{M-x customize}.  This
+command creates a @dfn{customization buffer} with which you can browse
+through the Emacs user options in a logically organized structure,
+then edit and set their values.  You can also use the customization
+buffer to save settings permanently in your @file{~/.emacs} file
+(@pxref{Init File}).
 
 The appearance of the example buffers in the following is typically
 different under a window system where faces can be used to indicate the
@@ -591,23 +592,24 @@ the faces in the group appear in the customization buffer.  Here is an
 example of how a face looks:
 
 @smallexample
-Custom Changed Face: (sample) [Hide]
+Custom Changed Face:(sample) [Hide]
    [State]: this face is unchanged from its standard setting.
-Parent groups: [Custom Magic Faces]
-Attributes: [ ] Font family: [Value Menu] *
-            [ ] Width: [Value Menu] *
-            [ ] Height: [Value Menu] *
-            [ ] Weight: [Value Menu] *
-            [ ] Slant: [Value Menu] *
-            [ ] Underline: [Value Menu] *
-            [ ] Overline: [Value Menu] *
-            [ ] Strike-through: [Value Menu] *
-            [ ] Box around text: [Value Menu] *
-            [ ] Inverse-video: [Value Menu] *
-            [X] Foreground: [Value Menu] Color: white       (sample)
-            [X] Background: [Value Menu] Color: blue        (sample)
-            [ ] Stipple: [Value Menu] *
-            [ ] Inherit:
+Face used when the customize item has been changed.
+Parent groups: => Custom Magic Faces
+Attributes: [ ] Font Family: *
+            [ ] Width: *
+            [ ] Height: *
+            [ ] Weight: *
+            [ ] Slant: *
+            [ ] Underline: *
+            [ ] Overline: *
+            [ ] Strike-through: *
+            [ ] Box around text: *
+            [ ] Inverse-video: *
+            [X] Foreground: white       (sample)
+            [X] Background: blue        (sample)
+            [ ] Stipple: *
+            [ ] Inherit: *
 @end smallexample
 
   Each face attribute has its own line.  The @samp{[@var{x}]} field
@@ -676,7 +678,8 @@ only for the specified option.
 
 @findex customize-face
   Likewise, you can modify a specific face, chosen by name, using
-@kbd{M-x customize-face}.
+@kbd{M-x customize-face}.  By default it operates on the face used
+on the character after point.
 
 @findex customize-group
   You can also set up the customization buffer with a specific group,
@@ -742,7 +745,7 @@ in @samp{-hooks} or @samp{-functions}, instead of @samp{-hook}.  What
 makes these hooks abnormal is that there is something peculiar about the
 way its functions are called---perhaps they are given arguments, or
 perhaps the values they return are used in some way.  For example,
-@code{find-file-not-found-hooks} (@pxref{Visiting}) is abnormal because
+@code{find-file-not-found-functions} (@pxref{Visiting}) is abnormal because
 as soon as one hook function returns a non-@code{nil} value, the rest
 are not called at all.  The documentation of each abnormal hook variable
 explains in detail what is peculiar about it.
@@ -923,7 +926,7 @@ the first line as well.
 
 @cindex shell scripts, and local file variables
   In shell scripts, the first line is used to identify the script
-interpreter, so you cannot put any local variables there.  To accomodate
+interpreter, so you cannot put any local variables there.  To accommodate
 for this, when Emacs visits a shell script, it looks for local variable
 specifications in the @emph{second} line.
 
@@ -968,8 +971,11 @@ list: a value for the variable @code{mode} really sets the major mode,
 and a value for the variable @code{eval} is simply evaluated as an
 expression and the value is ignored.  @code{mode} and @code{eval} are
 not real variables; setting variables named @code{mode} and @code{eval}
-in any other context has no special meaning.  If @code{mode} is used to
-set a major mode, it should be the first ``variable'' in the list.
+in any other context has no special meaning.  @emph{If @code{mode} is
+used to set a major mode, it should be the first ``variable'' in the
+list.}  Otherwise, the entries that precede it in the list of the local
+variables are likely to be ignored, since most modes kill all local
+variables as part of their initialization.
 
   You can use the @code{mode} ``variable'' to set minor modes as well as
 major modes; in fact, you can use it more than once, first to set the
@@ -1030,7 +1036,6 @@ about to type @kbd{C-n C-d} forty times, you can speed your work by
 defining a keyboard macro to do @kbd{C-n C-d} and calling it with a
 repeat count of forty.
 
-@c widecommands
 @table @kbd
 @item C-x (
 Start defining a keyboard macro (@code{start-kbd-macro}).
@@ -1116,10 +1121,18 @@ each line, you should position point at the start of a line, and define a
 macro to change that line and leave point at the start of the next line.
 Then repeating the macro will operate on successive lines.
 
-  After you have terminated the definition of a keyboard macro, you can add
-to the end of its definition by typing @kbd{C-u C-x (}.  This is equivalent
-to plain @kbd{C-x (} followed by retyping the whole definition so far.  As
-a consequence it re-executes the macro as previously defined.
+  When a command reads an argument with the minibuffer, your
+minibuffer input becomes part of the macro along with the command.  So
+when you replay the macro, the command gets the same argument as
+when you entered the macro.  For example,
+
+@example
+C-x ( C-a C-@key{SPC} C-n M-w C-x b f o o @key{RET} C-y C-x b @key{RET} C-x )
+@end example
+
+@noindent
+defines a macro that copies the current line into the buffer
+@samp{foo}, then returns to the original buffer.
 
   You can use function keys in a keyboard macro, just like keyboard
 keys.  You can even use mouse events, but be careful about that: when
@@ -1135,6 +1148,11 @@ expect.  But if it exits a recursive edit that started before you
 invoked the keyboard macro, it also necessarily exits the keyboard macro
 as part of the process.
 
+  After you have terminated the definition of a keyboard macro, you can add
+to the end of its definition by typing @kbd{C-u C-x (}.  This is equivalent
+to plain @kbd{C-x (} followed by retyping the whole definition so far.  As
+a consequence it re-executes the macro as previously defined.
+
 @findex edit-kbd-macro
 @kindex C-x C-k
   You can edit a keyboard macro already defined by typing @kbd{C-x C-k}
@@ -1163,7 +1181,7 @@ to execute the macro.  The macro name is a Lisp symbol, and defining it in
 this way makes it a valid command name for calling with @kbd{M-x} or for
 binding a key to with @code{global-set-key} (@pxref{Keymaps}).  If you
 specify a name that has a prior definition other than another keyboard
-macro, an error message is printed and nothing is changed.
+macro, an error message is shown and nothing is changed.
 
 @findex insert-kbd-macro
   Once a macro has a command name, you can save its definition in a file.
@@ -1332,12 +1350,12 @@ 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.
-These keys are ``reserved for users,'' so they won't conflict with any
-properly designed Emacs extension.  The function keys @key{F5} through
-@key{F9} are also reserved for users.  If you redefine some other key,
-your definition may be overridden by certain extensions or major modes
-which redefine the same key.
+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
+keys @key{F5} through @key{F9} are also reserved for users.  If you
+redefine some other key, your definition may be overridden by certain
+extensions or major modes which redefine the same key.
 
 @node Prefix Keymaps
 @subsection Prefix Keymaps
@@ -1606,6 +1624,15 @@ string, you can use the Emacs Lisp escape sequences, @samp{\t},
 
 @example
 (global-set-key "\C-x\t" 'indent-rigidly)
+@end example
+
+  These examples show how to write some other special ASCII characters
+in strings for key bindings:
+
+@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}
 @end example
 
   When the key sequence includes function keys or mouse button events,
@@ -1634,15 +1661,24 @@ 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 three examples, above, using vectors:
+  You can use a vector for the simple cases too.  Here's how to
+rewrite the first three examples above, using vectors to bind
+@kbd{C-z}, @kbd{C-x l}, and @kbd{C-x @key{TAB}}:
 
 @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)
 @end example
 
+@noindent
+As you see, you represent a multi-character key sequence with a vector
+by listing each of the characters within the square brackets that
+delimit the vector.
+
 @node Function Keys
 @subsection Rebinding Function Keys
 
@@ -1879,12 +1915,14 @@ events, if it has no binding).
 elapse between clicks and still allow them to be grouped as a multiple
 click.  Its value is in units of milliseconds.  If the value is
 @code{nil}, double clicks are not detected at all.  If the value is
-@code{t}, then there is no time limit.
+@code{t}, then there is no time limit.  The default is 500.
 
 @vindex double-click-fuzz
   The variable @code{double-click-fuzz} specifies how much the mouse
 can move between clicks still allow them to be grouped as a multiple
-click.  Its value is in units of pixels.
+click.  Its value is in units of pixels on windowed displays and in
+units of 1/8 of a character cell on text-mode terminals; the default is
+3.
 
   The symbols for mouse events also indicate the status of the modifier
 keys, with the usual prefixes @samp{C-}, @samp{M-}, @samp{H-},
@@ -1952,7 +1990,7 @@ command.  Here is the Lisp program to do this:
 @end example
 
   If the value of the @code{disabled} property is a string, that string
-is included in the message printed when the command is used:
+is included in the message displayed when the command is used:
 
 @example
 (put 'delete-region 'disabled
@@ -1966,6 +2004,12 @@ file directly or with the command @kbd{M-x disable-command}, which edits
 the @file{.emacs} file for you.  Likewise, @kbd{M-x enable-command}
 edits @file{.emacs} to enable a command permanently.  @xref{Init File}.
 
+  If Emacs was invoked with the @option{-q} or @option{--no-init-file}
+options (@pxref{Initial Options}), it will not edit your
+@file{~/.emacs} init file.  This is because editing the init file from
+such a session might overwrite the lines you might have on your init
+file which enable and disable commands.
+
   Whether a command is disabled is independent of what key is used to
 invoke it; disabling also applies if the command is invoked using
 @kbd{M-x}.  Disabling a command has no effect on calling it as a