aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2004-08-16 22:48:22 +0000
committerRichard M. Stallman2004-08-16 22:48:22 +0000
commit6f368e2d1cfb2e1bee4587d6b803d3721ec12e45 (patch)
tree1c313f1a78958b0fe2caf4f3810dc175bf74868e
parenta03748044a92bd693fe81c40651b77bfa69a67c4 (diff)
downloademacs-6f368e2d1cfb2e1bee4587d6b803d3721ec12e45.tar.gz
emacs-6f368e2d1cfb2e1bee4587d6b803d3721ec12e45.zip
(Non-ASCII Rebinding):
C-q always inserts the right code to pass to global-set-key.
-rw-r--r--man/custom.texi43
1 files changed, 15 insertions, 28 deletions
diff --git a/man/custom.texi b/man/custom.texi
index ce52431f3c6..aa5b35dc43e 100644
--- a/man/custom.texi
+++ b/man/custom.texi
@@ -1619,14 +1619,13 @@ because the terminal sends the same character in both cases.
1619@cindex rebinding non-@acronym{ASCII} keys 1619@cindex rebinding non-@acronym{ASCII} keys
1620@cindex non-@acronym{ASCII} keys, binding 1620@cindex non-@acronym{ASCII} keys, binding
1621 1621
1622If your keyboard has keys that send non-@acronym{ASCII} characters, such as 1622If your keyboard has keys that send non-@acronym{ASCII}
1623accented letters, rebinding these keys is a bit tricky. There are two 1623characters, such as accented letters, rebinding these keys
1624solutions you can use. One is to specify a keyboard coding system, 1624must be done by using a vector like this@footnote{Note that
1625using @code{set-keyboard-coding-system} (@pxref{Specify Coding}). 1625you should avoid the string syntax for binding
1626Then you can bind these keys in the usual way@footnote{Note that you 1626non-@acronym{ASCII} characters, since they will be
1627should avoid the string syntax for binding 8-bit characters, since 1627interpreted as meta keys. @xref{Strings of Events,,,elisp,
1628they will be interpreted as meta keys. @xref{Strings of 1628The Emacs Lisp Reference Manual}.}:
1629Events,,,elisp, The Emacs Lisp Reference Manual}.}, like this:
1630 1629
1631@example 1630@example
1632(global-set-key [?@var{char}] 'some-function) 1631(global-set-key [?@var{char}] 'some-function)
@@ -1635,27 +1634,15 @@ Events,,,elisp, The Emacs Lisp Reference Manual}.}, like this:
1635@noindent 1634@noindent
1636Type @kbd{C-q} followed by the key you want to bind, to insert @var{char}. 1635Type @kbd{C-q} followed by the key you want to bind, to insert @var{char}.
1637 1636
1638Since this puts a non-@acronym{ASCII} character in the @file{.emacs}, you should 1637Since this puts a non-@acronym{ASCII} character in the @file{.emacs},
1639specify the proper coding system for that file. @xref{Init Syntax}. 1638you should specify the proper coding system for that file. @xref{Init
1640Specify the same coding system for the file that you use for your 1639Syntax}. You should specify the same coding system for the file that
1641keyboard. 1640you use for your keyboard.
1642 1641
1643If you don't specify a keyboard coding system, that approach won't 1642@strong{Warning:} if you change the keyboard encoding, or change
1644work. Instead, you need to find out the actual code that the terminal 1643from unibyte to multibyte mode, such that the code that
1645sends. The easiest way to do this in Emacs is to create an empty 1644@kbd{C-q} inserts becomes different, you'll need to edit the
1646buffer with @kbd{C-x b temp @key{RET}}, make it unibyte with @kbd{M-x 1645Lisp expression accordingly.
1647toggle-enable-multibyte-characters @key{RET}}, then type the key to
1648insert the character into this buffer.
1649
1650Move point before the character, then type @kbd{C-x =}. This
1651displays a message in the minibuffer, showing the character code in
1652three ways, octal, decimal and hexadecimal, all within a set of
1653parentheses. Use the second of the three numbers, the decimal one,
1654inside the vector to bind:
1655
1656@example
1657(global-set-key [@var{decimal-code}] 'some-function)
1658@end example
1659 1646
1660If you bind 8-bit characters like this in your init file, you may find it 1647If you bind 8-bit characters like this in your init file, you may find it
1661convenient to specify that it is unibyte. @xref{Enabling Multibyte}. 1648convenient to specify that it is unibyte. @xref{Enabling Multibyte}.