emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lispref/commands.texi,v


From: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/lispref/commands.texi,v
Date: Mon, 31 Jul 2006 18:41:59 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Richard M. Stallman <rms>       06/07/31 18:41:58

Index: commands.texi
===================================================================
RCS file: /cvsroot/emacs/emacs/lispref/commands.texi,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -b -r1.90 -r1.91
--- commands.texi       27 Jul 2006 23:20:52 -0000      1.90
+++ commands.texi       31 Jul 2006 18:41:58 -0000      1.91
@@ -1087,7 +1087,7 @@
 latter as the symbol @code{tab}.
 
 Most of the time, it's not useful to distinguish the two.  So normally
address@hidden (@pxref{Translating Input}) is set up to map
address@hidden (@pxref{Translation Keymaps}) is set up to map
 @code{tab} into 9.  Thus, a key binding for character code 9 (the
 character @kbd{C-i}) also applies to @code{tab}.  Likewise for the other
 symbols in this group.  The function @code{read-char} likewise converts
@@ -2051,14 +2051,14 @@
 See also @code{momentary-string-display} in @ref{Temporary Displays},
 and @code{sit-for} in @ref{Waiting}.  @xref{Terminal Input}, for
 functions and variables for controlling terminal input modes and
-debugging terminal input.  @xref{Translating Input}, for features you
-can use for translating or modifying input events while reading them.
+debugging terminal input.
 
   For higher-level input facilities, see @ref{Minibuffers}.
 
 @menu
 * Key Sequence Input::         How to read one key sequence.
 * Reading One Event::          How to read just one event.
+* Event Mod::                   How Emacs modifies events as they are read.
 * Invoking the Input Method::   How reading an event uses the input method.
 * Quoted Character Input::     Asking the user to specify a character.
 * Event Input Misc::           How to reread or throw away input events.
@@ -2088,7 +2088,7 @@
 vector are the events in the key sequence.
 
 Reading a key sequence includes translating the events in various
-ways.  @xref{Translating Input}.
+ways.  @xref{Translation Keymaps}.
 
 The argument @var{prompt} is either a string to be displayed in the
 echo area as a prompt, or @code{nil}, meaning not to display a prompt.
@@ -2290,6 +2290,87 @@
 from the terminal---not counting those generated by keyboard macros.
 @end defvar
 
address@hidden Event Mod
address@hidden Modifying and Translating Input Events
+
+  Emacs modifies every event it reads according to
address@hidden, then translates it through
address@hidden (if applicable), before returning it
+from @code{read-event}.
+
address@hidden Emacs 19 feature
address@hidden extra-keyboard-modifiers
+This variable lets Lisp programs ``press'' the modifier keys on the
+keyboard.  The value is a character.  Only the modifiers of the
+character matter.  Each time the user types a keyboard key, it is
+altered as if those modifier keys were held down.  For instance, if
+you bind @code{extra-keyboard-modifiers} to @code{?\C-\M-a}, then all
+keyboard input characters typed during the scope of the binding will
+have the control and meta modifiers applied to them.  The character
address@hidden@@}, equivalent to the integer 0, does not count as a control
+character for this purpose, but as a character with no modifiers.
+Thus, setting @code{extra-keyboard-modifiers} to zero cancels any
+modification.
+
+When using a window system, the program can ``press'' any of the
+modifier keys in this way.  Otherwise, only the @key{CTL} and @key{META}
+keys can be virtually pressed.
+
+Note that this variable applies only to events that really come from
+the keyboard, and has no effect on mouse events or any other events.
address@hidden defvar
+
address@hidden keyboard-translate-table
+This variable is the translate table for keyboard characters.  It lets
+you reshuffle the keys on the keyboard without changing any command
+bindings.  Its value is normally a char-table, or else @code{nil}.
+(It can also be a string or vector, but this is considered obsolete.)
+
+If @code{keyboard-translate-table} is a char-table
+(@pxref{Char-Tables}), then each character read from the keyboard is
+looked up in this char-table.  If the value found there is
address@hidden, then it is used instead of the actual input character.
+
+Note that this translation is the first thing that happens to a
+character after it is read from the terminal.  Record-keeping features
+such as @code{recent-keys} and dribble files record the characters after
+translation.
+
+Note also that this translation is done before the characters are
+supplied to input methods (@pxref{Input Methods}).  Use
address@hidden (@pxref{Translation of Characters}),
+if you want to translate characters after input methods operate.
address@hidden defvar
+
address@hidden keyboard-translate from to
+This function modifies @code{keyboard-translate-table} to translate
+character code @var{from} into character code @var{to}.  It creates
+the keyboard translate table if necessary.
address@hidden defun
+
+  Here's an example of using the @code{keyboard-translate-table} to
+make @kbd{C-x}, @kbd{C-c} and @kbd{C-v} perform the cut, copy and paste
+operations:
+
address@hidden
+(keyboard-translate ?\C-x 'control-x)
+(keyboard-translate ?\C-c 'control-c)
+(keyboard-translate ?\C-v 'control-v)
+(global-set-key [control-x] 'kill-region)
+(global-set-key [control-c] 'kill-ring-save)
+(global-set-key [control-v] 'yank)
address@hidden example
+
address@hidden
+On a graphical terminal that supports extended @acronym{ASCII} input,
+you can still get the standard Emacs meanings of one of those
+characters by typing it with the shift key.  That makes it a different
+character as far as keyboard translation is concerned, but it has the
+same usual meaning.
+
+  @xref{Translation Keymaps}, for mechanisms that translate event sequences
+at the level of @code{read-key-sequence}.
+
 @node Invoking the Input Method
 @subsection Invoking the Input Method
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]