[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: Sun, 8 Oct 2006 18:27:36 -0700

    > (keymap "Variables"
    >         ("toto" "toto" lambda nil
    >          (interactive)
    >          (imenu--menubar-select
    >           '("toto" . #<marker at 37004 in foo.el>))))

    > `lookup-key' doesn't seem to help here - at least I cannot just pass
    > "Variables" as the key arg to it.

    You can try to pass ["Variables"].  But it's really not that
    simple, since
    you have to distinguish between the menu name and the "pseudo-key"
    associated with it.  In your examples, both are strings and
    they are equal,
    but that's not necessarily the case.
    You may want o check the easy-menu functions for that, tho they're not
    always as "easy" to use as the name implies.

Right. Thanks for your reply. I did try ["Variables"] (and [menu-bar index
"Variables"]), and I did study the easy-menu stuff. The easy-menu stuff
almost seemed as if it was going to get me what I needed, but I wasn't able
to make it work. Other suggestions are welcome, from anyone.

If there is no easy (or even feasible) way to do this, I wonder if it isn't
a mistake to "allow", or at least encourage, this kind of keymap entry -
Imenu is a standard library. If Imenu used the normal convention, there
would be no problem, and I don't think there would be a problem for Imenu
either. Is this more or less a bug, in that users cannot (at least not
easily, or any way I've found) look up such a key in the keymap (that is,
retrieve the submenu keymap)?

Anyway, I'm more immediately interested in finding a solution for the
current state, than in reporting a problem here. Help appreciated. Thanks to
Stefan, I feel a little confirmed in not having found a solution.

reply via email to

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