diff options
| author | Richard M. Stallman | 2004-08-16 22:48:22 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2004-08-16 22:48:22 +0000 |
| commit | 6f368e2d1cfb2e1bee4587d6b803d3721ec12e45 (patch) | |
| tree | 1c313f1a78958b0fe2caf4f3810dc175bf74868e | |
| parent | a03748044a92bd693fe81c40651b77bfa69a67c4 (diff) | |
| download | emacs-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.texi | 43 |
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 | ||
| 1622 | If your keyboard has keys that send non-@acronym{ASCII} characters, such as | 1622 | If your keyboard has keys that send non-@acronym{ASCII} |
| 1623 | accented letters, rebinding these keys is a bit tricky. There are two | 1623 | characters, such as accented letters, rebinding these keys |
| 1624 | solutions you can use. One is to specify a keyboard coding system, | 1624 | must be done by using a vector like this@footnote{Note that |
| 1625 | using @code{set-keyboard-coding-system} (@pxref{Specify Coding}). | 1625 | you should avoid the string syntax for binding |
| 1626 | Then you can bind these keys in the usual way@footnote{Note that you | 1626 | non-@acronym{ASCII} characters, since they will be |
| 1627 | should avoid the string syntax for binding 8-bit characters, since | 1627 | interpreted as meta keys. @xref{Strings of Events,,,elisp, |
| 1628 | they will be interpreted as meta keys. @xref{Strings of | 1628 | The Emacs Lisp Reference Manual}.}: |
| 1629 | Events,,,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 |
| 1636 | Type @kbd{C-q} followed by the key you want to bind, to insert @var{char}. | 1635 | Type @kbd{C-q} followed by the key you want to bind, to insert @var{char}. |
| 1637 | 1636 | ||
| 1638 | Since this puts a non-@acronym{ASCII} character in the @file{.emacs}, you should | 1637 | Since this puts a non-@acronym{ASCII} character in the @file{.emacs}, |
| 1639 | specify the proper coding system for that file. @xref{Init Syntax}. | 1638 | you should specify the proper coding system for that file. @xref{Init |
| 1640 | Specify the same coding system for the file that you use for your | 1639 | Syntax}. You should specify the same coding system for the file that |
| 1641 | keyboard. | 1640 | you use for your keyboard. |
| 1642 | 1641 | ||
| 1643 | If you don't specify a keyboard coding system, that approach won't | 1642 | @strong{Warning:} if you change the keyboard encoding, or change |
| 1644 | work. Instead, you need to find out the actual code that the terminal | 1643 | from unibyte to multibyte mode, such that the code that |
| 1645 | sends. 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 |
| 1646 | buffer with @kbd{C-x b temp @key{RET}}, make it unibyte with @kbd{M-x | 1645 | Lisp expression accordingly. |
| 1647 | toggle-enable-multibyte-characters @key{RET}}, then type the key to | ||
| 1648 | insert the character into this buffer. | ||
| 1649 | |||
| 1650 | Move point before the character, then type @kbd{C-x =}. This | ||
| 1651 | displays a message in the minibuffer, showing the character code in | ||
| 1652 | three ways, octal, decimal and hexadecimal, all within a set of | ||
| 1653 | parentheses. Use the second of the three numbers, the decimal one, | ||
| 1654 | inside the vector to bind: | ||
| 1655 | |||
| 1656 | @example | ||
| 1657 | (global-set-key [@var{decimal-code}] 'some-function) | ||
| 1658 | @end example | ||
| 1659 | 1646 | ||
| 1660 | If you bind 8-bit characters like this in your init file, you may find it | 1647 | If you bind 8-bit characters like this in your init file, you may find it |
| 1661 | convenient to specify that it is unibyte. @xref{Enabling Multibyte}. | 1648 | convenient to specify that it is unibyte. @xref{Enabling Multibyte}. |