help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Alt as meta, except for certain keys, how?


From: Jussi Piitulainen
Subject: Re: Alt as meta, except for certain keys, how?
Date: 13 Aug 2003 08:14:28 +0300
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Kevin Rodgers writes:

> Sorry, I was trying to show a general form via ellipses.  A concrete
> example would be
> 
> (define-key key-translation-map [?\M-7] "|")

Ah. That works all right, but when 7 is replaced with a letter outside
ASCII, it does not work.

> I don't know why those wouldn't work [] unless there are
> keyboard/buffer/file coding issues. You might want to use the octal
> encoding instead:
> 
> [?\M-\241] ; meta inverted exclamation point

That's again an interesting suggestion. I notice that ?\M-{inv excl}
and ?\M-\241 have different values, and C-x = shows an {inv excl} in
the buffer as octal 4241, not just 241. A coding issue, then, maybe,
and yes, the following indeed seems to do the trick:

          (define-key key-translation-map [?\M-\366] "*")

Octal 366 is Latin-1 for one of the letters I have a key for, the
letters shows as octal 4366 in the buffer, ?\M-{letter itself} does
not identify it for binding purposes, but ?\M-\366 seems to work.

Thank you.

> I don't understand Emacs' encoding scheme at all, nor do I want to.

Heh.

>> I think I'll use the numbers for these few keys.
> 
> The "Character Type" node of the Emacs Lisp manual strongly
> discourages that:

Of course, and I agree, but I was failing to find any other way to
make it work. That octal syntax seems to do it, and all in standard
Latin-1, too, so I will change to use that instead.
-- 
Jussi 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]