all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
Subject: RE: looking up a submenu keymap in a menu keymap, when the submenu key is a string
Date: Mon, 9 Oct 2006 18:31:38 -0700	[thread overview]
Message-ID: <EIENLHALHGIMHGDOLMIMEENBCLAA.drew.adams@oracle.com> (raw)
In-Reply-To: <jwviritmo4j.fsf-monnier+emacs@gnu.org>

    > I map over a keymap with `map-keymap', so I have the `event'
    > and `binding' arguments. I build an alist of (name . binding)
    > pairs, where `name' is a string that includes external names
    > of the key and its command, or "..." for a prefix map - examples:
    >
    >  "C-a  =  beginning-of-line"
    >  "C-x  = ..."

    So that's why you rely crucially on read-kbd-macro being an
    exact inverse of single-key-description?  Sounds like bad design.
    Why not return an alist of the form (name key binding) so you can
    always trivially recover the `key' from the name, without even
    using read-kbd-macro?

Well, that was going to be my next step, after you had explained that the
same string (eq) was needed and would work. Yes, it will be simpler. Using
simple strings seemed simpler initially; sometimes, what seems simpler is
not. It now appears that moving between name and key for this use is
non-trivial, and that keeping the key and binding around is simpler.

I added the real binding for that same reason, in fact. I originally used
just the external key name and command name, both strings. That worked fine
for all but the menu-bar keymap, which was not part of the original idea.
The real binding was needed for the menu-bar keymap, and the real key is
apparently needed for the Imenu keymap.

Thanks for your feedback.

      reply	other threads:[~2006-10-10  1:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-08 18:34 looking up a submenu keymap in a menu keymap, when the submenu key is a string Drew Adams
2006-10-09  1:02 ` Stefan Monnier
2006-10-09  1:27   ` Drew Adams
2006-10-09  5:07     ` Stefan Monnier
2006-10-09 15:36       ` Drew Adams
2006-10-09 16:57         ` Stefan Monnier
2006-10-10  1:31           ` Drew Adams [this message]

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=EIENLHALHGIMHGDOLMIMEENBCLAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.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.