[Top][All Lists]

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

RE: looking up a submenu keymap in a menu keymap, when the submenu key i

From: Drew Adams
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

    > 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 via email to

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