emacs-devel
[Top][All Lists]
Advanced

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

Re: Format av menu keymaps


From: Stefan Monnier
Subject: Re: Format av menu keymaps
Date: Mon, 09 Jan 2006 23:21:51 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>> There's something odd in this code snice for each iteration of map-keymap
>> you end up rebinding the same key with `define-key' so only ther last one
>> will have an effect.
> Yes, it is odd.  I am using map-keymap just to get the 'command'.  (There
> is only one entry in menu-bar-entry.) Is there another way?

So you assume there will only be one entry.  What happens if there are
2 entries?  If you know for sure that there'll only ever be 1 entry in that
map, is that the only thing you know about that map, or do you also know
more about it?

>> Why do you use `appmenu-get-submenu' to destructure the menu-item only to
>> rebuild it right after.
> The submenu I gave is just an example. I do not know the format of the
> submenu normally.

The question still stands: why massage the format, whichever it is: if it
works in [menu-bar] it should work where you'll use it, without touching it
at all.

> `appmenu-get-submenu' (see previous message) handles those two formats for
> a submenu that I have seen. There may be more, but I do not know.  Are
> there more?

I don't think so, although the (menu-item ...) format is sufficiently rich
that the way you handle it is incomplete.  See the elisp manual for
a complete description.


        Stefan




reply via email to

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