all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: Alt as meta, except for certain keys, how?
Date: Mon, 11 Aug 2003 13:54:09 -0600	[thread overview]
Message-ID: <3F37F461.3030109@yahoo.com> (raw)
In-Reply-To: mailman.235.1060378027.29551.help-gnu-emacs@gnu.org

Ehud Karni wrote:

>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) !!!


Hmmm, here's what I get:


Character typed is (No description), (octal=37000000067, decimal=-134217673, 
hexa=f8000037)

 
>>>So if you do:
>>>  (define-key key-translation-map [4194359] "|")
>>
>>key-translation-map takes character arguments, not (vector or string) keys:
> 
> Not true, see below.
...
>>>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.

Ah, you're correct of course!  Sorry about that.

But the manual says that "The intent of `key-translation-map' is for
users to map one character set to another", so doesn't this count as
abuse (rather than use) of that feature?  It seems odd to me --
backwards, even -- that keyboard-translate-table can't handle all the
events (such as meta-modified characters) that the keyboard can
generate, but that key-translation-map can (even though it is intended
to map only characters).

-- 
Kevin Rodgers

  parent reply	other threads:[~2003-08-11 19:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-07 17:33 Alt as meta, except for certain keys, how? Jussi Piitulainen
2003-08-07 18:38 ` Kevin Rodgers
2003-08-08  7:05   ` Ehud Karni
     [not found]   ` <mailman.222.1060326618.29551.help-gnu-emacs@gnu.org>
2003-08-08 18:51     ` Kevin Rodgers
2003-08-08 21:26       ` Ehud Karni
     [not found]       ` <mailman.235.1060378027.29551.help-gnu-emacs@gnu.org>
2003-08-11 18:10         ` Jussi Piitulainen
2003-08-11 20:29           ` Kevin Rodgers
2003-08-12  8:26             ` Jussi Piitulainen
2003-08-12 17:14               ` Kevin Rodgers
2003-08-13  5:14                 ` Jussi Piitulainen
2003-08-15 13:05             ` Kai Großjohann
2003-08-11 19:54         ` Kevin Rodgers [this message]
2003-08-12 11:13           ` Ehud Karni
     [not found]           ` <mailman.336.1060687053.29551.help-gnu-emacs@gnu.org>
2003-08-12 18:16             ` Jussi Piitulainen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F37F461.3030109@yahoo.com \
    --to=ihs_4664@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.