On Fri, 08 Aug 2003 12:51:59 -0600, Kevin Rodgers <ihs_4664@yahoo.com> wrote:
Ehud Karni wrote:
On my system it shows for Alt-7:
Character typed is "7", (octal=20000067, decimal=4194359, hexa=400037)
Just evaluate ?\M-7. On my system, it is -134217673, which is the crux of the
problem: meta-modified characters may have a negative character code, and thus
may not be a valid index into a char-table.
I did evaluate ?\M-7 and I get the same result (-134217673) as you.
It is NOT what my function returns (4194359) !!!
Because key-translation-map may not exist, you better protect yourself
by adding the following (before the define-key command):
(if (not key-translation-map)
(make-sparse-keymap key-translation-map))
key-translation-map is now a char-table, not a keymap (see the Translating Input
node of the Emacs Lisp manual).
I don't know which Emacs are you using, I checked it on 21.2, 21.3. and
21.3.50 (CVS HEAD version). On all the documentation for `
key-translation-map' says:
Keymap of key translations that can override keymaps.
This keymap works like `function-key-map', but comes after that,
and applies even for keys that have ordinary bindings.
I think you confuse it with `keyboard-translate-table' which is
used/created by the `keyboard-translate' command.