unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ken Manheimer" <ken.manheimer@gmail.com>
To: "Stefan Monnier" <monnier@iro.umontreal.ca>
Cc: emacs-devel <emacs-devel@gnu.org>, Miles Bader <miles@gnu.org>
Subject: Re: identifying meta-key bound functions from last-command-char?
Date: Tue, 26 Feb 2008 17:57:25 -0500	[thread overview]
Message-ID: <2cd46e7f0802261457k5a8f291duf3c6641a29f0aa70@mail.gmail.com> (raw)
In-Reply-To: <jwv8x17eor0.fsf-monnier+emacs@gnu.org>

On 2/26/08, Stefan Monnier <monnier@iro.umontreal.ca> 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
last-command-event
  (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.)
--
ken
http://myriadicity.net




  reply	other threads:[~2008-02-26 22:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-26  0:30 identifying meta-key bound functions from last-command-char? Ken Manheimer
2008-02-26  2:07 ` Stefan Monnier
2008-02-26  2:21 ` Kenichi Handa
2008-02-26  2:33   ` Stefan Monnier
2008-02-26  3:59     ` Kenichi Handa
2008-02-26  4:46       ` Stefan Monnier
2008-02-26  6:08 ` Miles Bader
2008-02-26  6:28   ` Ken Manheimer
2008-02-26 15:13     ` Stefan Monnier
2008-02-26 22:57       ` Ken Manheimer [this message]
2008-02-27  2:10         ` Stefan Monnier

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=2cd46e7f0802261457k5a8f291duf3c6641a29f0aa70@mail.gmail.com \
    --to=ken.manheimer@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=miles@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).