emacs-devel
[Top][All Lists]
Advanced

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

Re: identifying meta-key bound functions from last-command-char?


From: Kenichi Handa
Subject: Re: identifying meta-key bound functions from last-command-char?
Date: Tue, 26 Feb 2008 11:21:18 +0900
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/23.0.60 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

In article <address@hidden>, "Ken Manheimer" <address@hidden> writes:

> [1  <text/plain; ISO-8859-1 (7bit)>]
> in a recent emacs build a technique i've been using to deliberately fetch
> key bindings according to the last-command-char is failing for meta-modified
> keys.  the problem is that, for meta-modified keys,

>   (characterp last-command-char) => nil

> this breaks an approach like:

>   (key-binding (char-to-string last-command-char))

> i need some way to fetch bindings according to last-command-char for a
> special key handler that i use in overlays and, (for example) in
> allout.elallout-hotspot-key-handler, a pre-command-hook function.
> though probably
> overly complicated, it has worked through the released emacs 22.  in the
> recent cvs build (23.0.60), i get an error:

>   wrong-type-argument characterp 134217760

> (that's for "\M- " meta space, but the same things happens for other meta
> keys.)  i'm failing to figure out how to translate the meta-modified key to
> something that i can use for key-binding, and presume i'm missing something
> obvious.  can someone steer me in the right direction?

Unfortunately, I think Emacs doesn't have a clear view about
how to handle an integer which contains a character code and
meta-modifier masks.  Is it a character or not?

I think it's not a character but an event object, so the
above code should be:
  (key-binding (vector last-command-char))

The related problem is when to change, for instance, (' ' |
CTRL_MASK) to '\0'.  Now Emacs signals an error when we type
C-q C-SPC.

---
Kenichi Handa
address@hidden




reply via email to

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