[Top][All Lists]

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

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

From: Ken Manheimer
Subject: Re: identifying meta-key bound functions from last-command-char?
Date: Tue, 26 Feb 2008 17:57:25 -0500

On 2/26/08, Stefan Monnier <address@hidden> wrote:
> > using 'vector' instead of char-to-string solved my problem - thanks, all!
> Using strings for "sequence of events" is a hack that happened to work
>  back in the tty days and was made obsolete (tho sadly still supported)
>  when X11 support was added.

the closest lead i found in the elisp info manual was 21.6.14 _Putting
Keyboard Events in Strings_, and it distinctly does not address my
need.  i think the details are missing from the manual, and that could
be repaired.

as i see it, the purpose is not too obscure or unusual: deliberately
identifying a key binding for user-entered keys from within a handler
that's intervening in the command loop, eg, on pre-command-hook,
overlay modification-hooks, or something like that.  last-command-char
/ last-command-event is the only data structure i found for getting
the input, and the only details about using that are very brief, in
21.4, _Information from the Command Loop_.

i expect that the details - using `(keyboard-binding (vector
last-command-char))' - belong somewhere in the 21.6 _Input Events_
section, perhaps in 21.6.1 _Keyboard Events_?  there could then be a
footnote / link from 21.6.14 _Putting Keyboard Events in Strings_ and
the entry for last-command-char / -event in 21.4.

the text could go below what currently exists in 21.6.1.  i don't have
enough grasp of input events to be complete, but here's a description
of the context i do know:

  To handle command-loop input from a hook function, like a pre-command-hook
  or modification-hooks entry, you can get the input event from
  (see _Keyboard Events_).  You can identify a keybinding for that input using:

    ``(keyboard-binding (vector last-command-event))''

can anyone help flesh this out?  i would have spent a lot less time
thrashing if the info were easier to find.  (it still may make sense
to repair char-to-string, though.)

reply via email to

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