comparison man/custom.texi @ 65031:177b0fcf58b9

(Minor Modes): Say that the list here is not complete. (Keyboard Translations): Node deleted. (Disabling): Delete xref to it. (Customization Groups): Fix Custom buffer example. (Hooks): Mention remove-hooks.
author Richard M. Stallman <rms@gnu.org>
date Thu, 18 Aug 2005 15:01:06 +0000
parents 3723093a21fd
children 3faeba93ad9e 2d92f5c9d6ae
comparison
equal deleted inserted replaced
65030:a093a1e65b71 65031:177b0fcf58b9
31 * Variables:: Many Emacs commands examine Emacs variables 31 * Variables:: Many Emacs commands examine Emacs variables
32 to decide what to do; by setting variables, 32 to decide what to do; by setting variables,
33 you can control their functioning. 33 you can control their functioning.
34 * Key Bindings:: The keymaps say what command each key runs. 34 * Key Bindings:: The keymaps say what command each key runs.
35 By changing them, you can "redefine keys". 35 By changing them, you can "redefine keys".
36 * Keyboard Translations:: If your keyboard passes an undesired code
37 for a key, you can tell Emacs to
38 substitute another code.
39 * Syntax:: The syntax table controls how words and 36 * Syntax:: The syntax table controls how words and
40 expressions are parsed. 37 expressions are parsed.
41 * Init File:: How to write common customizations in the 38 * Init File:: How to write common customizations in the
42 @file{.emacs} file. 39 @file{.emacs} file.
43 @end menu 40 @end menu
76 @code{outline-minor-mode} as a variable; it is this variable that 73 @code{outline-minor-mode} as a variable; it is this variable that
77 directly turns Outline minor mode on and off. To check whether a 74 directly turns Outline minor mode on and off. To check whether a
78 given minor mode works this way, use @kbd{C-h v} to ask for 75 given minor mode works this way, use @kbd{C-h v} to ask for
79 documentation on the variable name. 76 documentation on the variable name.
80 77
81 These minor-mode variables provide a good way for Lisp programs to turn 78 These minor-mode variables provide a good way for Lisp programs to
82 minor modes on and off; they are also useful in a file's local variables 79 turn minor modes on and off; they are also useful in a file's local
83 list. But please think twice before setting minor modes with a local 80 variables list (@pxref{File Variables}). But please think twice
84 variables list, because most minor modes are a matter of user 81 before setting minor modes with a local variables list, because most
85 preference---other users editing the same file might not want the same 82 minor modes are a matter of user preference---other users editing the
86 minor modes you prefer. 83 same file might not want the same minor modes you prefer.
87 84
88 The buffer-local minor modes include Abbrev mode, Auto Fill mode, 85 The most useful buffer-local minor modes include Abbrev mode, Auto
89 Auto Save mode, Font-Lock mode, Glasses mode, ISO Accents mode, 86 Fill mode, Auto Save mode, Font-Lock mode, Glasses mode, ISO Accents
90 Outline minor mode, Overwrite mode, and Binary Overwrite mode. 87 mode, Outline minor mode, Overwrite mode, and Binary Overwrite mode.
91 88
92 Abbrev mode allows you to define abbreviations that automatically expand 89 Abbrev mode allows you to define abbreviations that automatically expand
93 as you type them. For example, @samp{amd} might expand to @samp{abbrev 90 as you type them. For example, @samp{amd} might expand to @samp{abbrev
94 mode}. @xref{Abbrevs}, for full information. 91 mode}. @xref{Abbrevs}, for full information.
95 92
144 binary files; it treats newlines and tabs like other characters, so that 141 binary files; it treats newlines and tabs like other characters, so that
145 they overwrite other characters and can be overwritten by them. 142 they overwrite other characters and can be overwritten by them.
146 In Binary Overwrite mode, digits after @kbd{C-q} specify an 143 In Binary Overwrite mode, digits after @kbd{C-q} specify an
147 octal character code, as usual. 144 octal character code, as usual.
148 145
149 The following minor modes normally apply to all buffers at once. 146 Here are some useful minor modes that normally apply to all buffers
150 Since each is enabled or disabled by the value of a variable, you 147 at once. Since each is enabled or disabled by the value of a
151 @emph{can} set them differently for particular buffers, by explicitly 148 variable, you @emph{can} set them differently for particular buffers,
152 making the corresponding variables local in those buffers. 149 by explicitly making the corresponding variables local in those
153 @xref{Locals}. 150 buffers. @xref{Locals}.
154 151
155 Icomplete mode displays an indication of available completions when 152 Icomplete mode displays an indication of available completions when
156 you are in the minibuffer and completion is active. @xref{Completion 153 you are in the minibuffer and completion is active. @xref{Completion
157 Options}. 154 Options}.
158 155
219 @smallexample 216 @smallexample
220 /- Emacs group: ---------------------------------------------------\ 217 /- Emacs group: ---------------------------------------------------\
221 [State]: visible group members are all at standard settings. 218 [State]: visible group members are all at standard settings.
222 Customization of the One True Editor. 219 Customization of the One True Editor.
223 See also [Manual]. 220 See also [Manual].
224
225 Confirm Kill Emacs: [Hide] [Value Menu] Don't confirm
226 [State]: this option is unchanged from its standard setting.
227 How to ask for confirmation when leaving Emacs. [More]
228 221
229 Editing group: [Go to Group] 222 Editing group: [Go to Group]
230 Basic text editing facilities. 223 Basic text editing facilities.
231 224
232 External group: [Go to Group] 225 External group: [Go to Group]
852 ``asking for trouble.'' However, the order is predictable: the most 845 ``asking for trouble.'' However, the order is predictable: the most
853 recently added hook functions are executed first. 846 recently added hook functions are executed first.
854 847
855 If you play with adding various different versions of a hook 848 If you play with adding various different versions of a hook
856 function by calling @code{add-hook} over and over, remember that all 849 function by calling @code{add-hook} over and over, remember that all
857 the versions you added will remain in the hook variable together. 850 the versions you added will remain in the hook variable together. You
858 To clear them out, you can do @code{(setq @var{hook-variable} nil)}. 851 can clear out individual functions with @code{remove-hook}, or do
852 @code{(setq @var{hook-variable} nil)} to remove everything.
859 853
860 @node Locals 854 @node Locals
861 @subsection Local Variables 855 @subsection Local Variables
862 856
863 @table @kbd 857 @table @kbd
1636 1630
1637 @cindex keypad 1631 @cindex keypad
1638 Many keyboards have a ``numeric keypad'' on the right hand side. 1632 Many keyboards have a ``numeric keypad'' on the right hand side.
1639 The numeric keys in the keypad double up as cursor motion keys, 1633 The numeric keys in the keypad double up as cursor motion keys,
1640 toggled by a key labelled @samp{Num Lock}. By default, Emacs 1634 toggled by a key labelled @samp{Num Lock}. By default, Emacs
1641 translates these keys to the corresponding keys in the main keyboard 1635 translates these keys to the corresponding keys in the main keyboard.
1642 (@pxref{Keyboard Translations}). For example, when @samp{Num Lock} is 1636 For example, when @samp{Num Lock} is on, the key labelled @samp{8} on
1643 on, the key labelled @samp{8} on the numeric keypad produces 1637 the numeric keypad produces @code{kp-8}, which is translated to
1644 @code{kp-8}, which is translated to @kbd{8}; when @samp{Num Lock} is 1638 @kbd{8}; when @samp{Num Lock} is off, the same key produces
1645 off, the same key produces @code{kp-up}, which is translated to 1639 @code{kp-up}, which is translated to @key{UP}. If you rebind a key
1646 @key{UP}. If you rebind a key such as @kbd{8} or @key{UP}, it affects 1640 such as @kbd{8} or @key{UP}, it affects the equivalent keypad key too.
1647 the equivalent keypad key too. However, if you rebind a @samp{kp-} 1641 However, if you rebind a @samp{kp-} key directly, that won't affect
1648 key directly, that won't affect its non-keypad equivalent. 1642 its non-keypad equivalent.
1649 1643
1650 Emacs provides a convenient method for binding the numeric keypad 1644 Emacs provides a convenient method for binding the numeric keypad
1651 keys, using the variables @code{keypad-setup}, 1645 keys, using the variables @code{keypad-setup},
1652 @code{keypad-numlock-setup}, @code{keypad-shifted-setup}, and 1646 @code{keypad-numlock-setup}, @code{keypad-shifted-setup}, and
1653 @code{keypad-numlock-shifted-setup}. These can be found in the 1647 @code{keypad-numlock-shifted-setup}. These can be found in the
1891 Whether a command is disabled is independent of what key is used to 1885 Whether a command is disabled is independent of what key is used to
1892 invoke it; disabling also applies if the command is invoked using 1886 invoke it; disabling also applies if the command is invoked using
1893 @kbd{M-x}. Disabling a command has no effect on calling it as a 1887 @kbd{M-x}. Disabling a command has no effect on calling it as a
1894 function from Lisp programs. 1888 function from Lisp programs.
1895 1889
1896 @node Keyboard Translations
1897 @section Keyboard Translations
1898
1899 Some keyboards do not make it convenient to send all the special
1900 characters that Emacs uses. The most common problem case is the
1901 @key{DEL} character. Some keyboards provide no convenient way to type
1902 this very important character---usually because they were designed to
1903 expect the character @kbd{C-h} to be used for deletion. On these
1904 keyboards, if you press the key normally used for deletion, Emacs handles
1905 the @kbd{C-h} as a prefix character and offers you a list of help
1906 options, which is not what you want.
1907
1908 @cindex keyboard translations
1909 @findex keyboard-translate
1910 You can work around this problem within Emacs by setting up keyboard
1911 translations to turn @kbd{C-h} into @key{DEL} and @key{DEL} into
1912 @kbd{C-h}, as follows:
1913
1914 @example
1915 ;; @r{Translate @kbd{C-h} to @key{DEL}.}
1916 (keyboard-translate ?\C-h ?\C-?)
1917
1918 ;; @r{Translate @key{DEL} to @kbd{C-h}.}
1919 (keyboard-translate ?\C-? ?\C-h)
1920 @end example
1921
1922 Keyboard translations are not the same as key bindings in keymaps
1923 (@pxref{Keymaps}). Emacs contains numerous keymaps that apply in
1924 different situations, but there is only one set of keyboard
1925 translations, and it applies to every character that Emacs reads from
1926 the terminal. Keyboard translations take place at the lowest level of
1927 input processing; the keys that are looked up in keymaps contain the
1928 characters that result from keyboard translation.
1929
1930 On a window system, the keyboard key named @key{DELETE} is a function
1931 key and is distinct from the @acronym{ASCII} character named @key{DEL}.
1932 @xref{Named ASCII Chars}. Keyboard translations affect only @acronym{ASCII}
1933 character input, not function keys; thus, the above example used on a
1934 window system does not affect the @key{DELETE} key. However, the
1935 translation above isn't necessary on window systems, because Emacs can
1936 also distinguish between the @key{BACKSPACE} key and @kbd{C-h}; and it
1937 normally treats @key{BACKSPACE} as @key{DEL}.
1938
1939 For full information about how to use keyboard translations, see
1940 @ref{Translating Input,,,elisp, The Emacs Lisp Reference Manual}.
1941
1942 @node Syntax 1890 @node Syntax
1943 @section The Syntax Table 1891 @section The Syntax Table
1944 @cindex syntax table 1892 @cindex syntax table
1945 1893
1946 All the Emacs commands which parse words or balance parentheses are 1894 All the Emacs commands which parse words or balance parentheses are