]> code.delx.au - gnu-emacs/blobdiff - man/custom.texi
Version 3.09
[gnu-emacs] / man / custom.texi
index 7dbd8af2458f65671a03faee275b4cdd3e4a1231..ffded429c48682b27f362097658c3bd0b7f55039 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,2001,2002,2004
+@c Copyright (C) 1985,86,87,93,94,95,97,2000,2001,2002,2004,2005
 @c  Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Customization, Quitting, Amusements, Top
@@ -27,19 +27,17 @@ replay sequences of keys.
 @menu
 * Minor Modes::                Each minor mode is one feature you can turn on
                          independently of any others.
-* Easy Customization::
-                        Convenient way to browse and change user options.
+* Easy Customization::  Convenient way to browse and change user options.
 * Variables::          Many Emacs commands examine Emacs variables
                          to decide what to do; by setting variables,
                          you can control their functioning.
 * Key Bindings::       The keymaps say what command each key runs.
                          By changing them, you can "redefine keys".
-* Keyboard Translations::
-                        If your keyboard passes an undesired code
-                          for a key, you can tell Emacs to
-                          substitute another code.
+* Keyboard Translations:: If your keyboard passes an undesired code
+                         for a key, you can tell Emacs to
+                         substitute another code.
 * Syntax::             The syntax table controls how words and
-                          expressions are parsed.
+                         expressions are parsed.
 * Init File::          How to write common customizations in the
                          @file{.emacs} file.
 @end menu
@@ -345,8 +343,9 @@ unacceptable value.
 @kindex M-TAB @r{(customization buffer)}
 @findex widget-complete
   While editing a value or field that is a file name, directory name,
-command name, or anything else for which completion is defined, you can
-type @kbd{M-@key{TAB}} (@code{widget-complete}) to do completion.
+command name, or anything else for which completion is defined, you
+can type @kbd{M-@key{TAB}} (@code{widget-complete}) to do completion.
+(@kbd{@key{ESC} @key{TAB}} and @kbd{C-M-i} do the same thing.)
 
   Some variables have a small fixed set of possible legitimate values.
 These variables don't let you edit the value textually.  Instead, an
@@ -506,9 +505,12 @@ customization files for different Emacs versions, like this:
       ((and (= emacs-major-version 21) (< emacs-minor-version 4))
        ;; @r{Emacs 21 customization, before version 21.4.}
        (setq custom-file "~/.custom-21.el"))
-      (t
+      ((< emacs-major-version 22)
        ;; @r{Emacs version 21.4 or later.}
-       (setq custom-file "~/.custom-21.4.el")))
+       (setq custom-file "~/.custom-21.4.el"))
+      (t
+       ;; @r{Emacs version 22.1 or later.}
+       (setq custom-file "~/.custom-22.el")))
 
 (load custom-file)
 @end example
@@ -1632,6 +1634,27 @@ word:
 (global-set-key [H-M-right] 'forward-word)
 @end example
 
+@cindex keypad
+  Many keyboards have a ``numeric keypad'' on the right hand side.
+The numeric keys in the keypad double up as cursor motion keys,
+toggled by a key labelled @samp{Num Lock}.  By default, Emacs
+translates these keys to the corresponding keys in the main keyboard
+(@pxref{Keyboard Translations}).  For example, when @samp{Num Lock} is
+on, the key labelled @samp{8} on the numeric keypad produces
+@code{kp-8}, which is translated to @kbd{8}; when @samp{Num Lock} is
+off, the same key produces @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.
+
+  Emacs provides a convenient method for binding the numeric keypad
+keys, using the variables @code{keypad-setup},
+@code{keypad-numlock-setup}, @code{keypad-shifted-setup}, and
+@code{keypad-numlock-shifted-setup}.  These can be found in the
+@samp{keyboard} customization group (@pxref{Easy Customization}).  You
+can rebind the keys to perform other tasks, such as issuing numeric
+prefix arguments.
+
 @node Named ASCII Chars
 @subsection Named @acronym{ASCII} Control Characters
 
@@ -2288,8 +2311,44 @@ Enable the use of the command @code{narrow-to-region} without confirmation.
 @example
 (put 'narrow-to-region 'disabled nil)
 @end example
+
+@item
+Adjusting the configuration to various contexts.
+
+In most of the cases, people want their Emacs to behave the same on
+all their machines, so their configuration should be the same, no
+matter whether it's GNU/Linux or not, under X11 or on a tty, with one
+version of  Emacs or another, ...
+
+What can happen, tho, is that depending on the circumstance some
+features may or may not be available.  In that case just prepend each
+such customization with a little test that ensures that the feature
+can be used.  The best tests are usually checking that the feature is
+available, rather than checking what kind of environment is
+being used.
+
+@example
+(if (fboundp 'blinking-cursor-mode)
+    (blinking-cursor-mode 0))
+@end example
+
+@example
+(if (boundp 'coding-category-utf-8)
+  (set-coding-priority '(coding-category-utf-8)))
+@end example
+
+@example
+(require 'cl)                   ; To define `ignore-errors'.
+(ignore-errors (set-face-background 'region "grey75"))
+@end example
+
+Note also that a @code{setq} on a variable which does not exist is
+generally harmless, so those usually do not need to be made
+conditional on any kind of test.
+
 @end itemize
 
+
 @node Terminal Init
 @subsection Terminal-specific Initialization