/[emacs]/emacs/man/custom.texi
ViewVC logotype

Diff of /emacs/man/custom.texi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.64 by harder, Sun Jun 20 14:45:41 2004 UTC revision 1.65 by rms, Mon Aug 16 22:48:22 2004 UTC
# Line 1619  because the terminal sends the same char Line 1619  because the terminal sends the same char
1619  @cindex rebinding non-@acronym{ASCII} keys  @cindex rebinding non-@acronym{ASCII} keys
1620  @cindex non-@acronym{ASCII} keys, binding  @cindex non-@acronym{ASCII} keys, binding
1621    
1622  If your keyboard has keys that send non-@acronym{ASCII} characters, such as  If your keyboard has keys that send non-@acronym{ASCII}
1623  accented letters, rebinding these keys is a bit tricky.  There are two  characters, such as accented letters, rebinding these keys
1624  solutions you can use.  One is to specify a keyboard coding system,  must be done by using a vector like this@footnote{Note that
1625  using @code{set-keyboard-coding-system} (@pxref{Specify Coding}).  you should avoid the string syntax for binding
1626  Then you can bind these keys in the usual way@footnote{Note that you  non-@acronym{ASCII} characters, since they will be
1627  should avoid the string syntax for binding 8-bit characters, since  interpreted as meta keys.  @xref{Strings of Events,,,elisp,
1628  they will be interpreted as meta keys.  @xref{Strings of  The Emacs Lisp Reference Manual}.}:
 Events,,,elisp, The Emacs Lisp Reference Manual}.}, like this:  
1629    
1630  @example  @example
1631  (global-set-key [?@var{char}] 'some-function)  (global-set-key [?@var{char}] 'some-function)
# Line 1635  Events,,,elisp, The Emacs Lisp Reference Line 1634  Events,,,elisp, The Emacs Lisp Reference
1634  @noindent  @noindent
1635  Type @kbd{C-q} followed by the key you want to bind, to insert @var{char}.  Type @kbd{C-q} followed by the key you want to bind, to insert @var{char}.
1636    
1637  Since this puts a non-@acronym{ASCII} character in the @file{.emacs}, you should  Since this puts a non-@acronym{ASCII} character in the @file{.emacs},
1638  specify the proper coding system for that file.  @xref{Init Syntax}.  you should specify the proper coding system for that file.  @xref{Init
1639  Specify the same coding system for the file that you use for your  Syntax}.  You should specify the same coding system for the file that
1640  keyboard.  you use for your keyboard.
1641    
1642  If you don't specify a keyboard coding system, that approach won't  @strong{Warning:} if you change the keyboard encoding, or change
1643  work.  Instead, you need to find out the actual code that the terminal  from unibyte to multibyte mode, such that the code that
1644  sends.  The easiest way to do this in Emacs is to create an empty  @kbd{C-q} inserts becomes different, you'll need to edit the
1645  buffer with @kbd{C-x b temp @key{RET}}, make it unibyte with @kbd{M-x  Lisp expression accordingly.
 toggle-enable-multibyte-characters @key{RET}}, then type the key to  
 insert the character into this buffer.  
   
 Move point before the character, then type @kbd{C-x =}.  This  
 displays a message in the minibuffer, showing the character code in  
 three ways, octal, decimal and hexadecimal, all within a set of  
 parentheses.  Use the second of the three numbers, the decimal one,  
 inside the vector to bind:  
   
 @example  
 (global-set-key [@var{decimal-code}] 'some-function)  
 @end example  
1646    
1647  If you bind 8-bit characters like this in your init file, you may find it  If you bind 8-bit characters like this in your init file, you may find it
1648  convenient to specify that it is unibyte.  @xref{Enabling Multibyte}.  convenient to specify that it is unibyte.  @xref{Enabling Multibyte}.

Legend:
Removed from v.1.64  
changed lines
  Added in v.1.65

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26