From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Format av menu keymaps Date: Mon, 09 Jan 2006 23:21:51 -0500 Message-ID: <87k6d8k98r.fsf-monnier+emacs@gnu.org> References: <43C191E2.6030206@student.lu.se> <87r77ikuia.fsf-monnier+emacs@gnu.org> <43C2D976.5050302@student.lu.se> <43C2F87B.1030401@student.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1136866938 22064 80.91.229.2 (10 Jan 2006 04:22:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 10 Jan 2006 04:22:18 +0000 (UTC) Cc: Emacs Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 10 05:22:14 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EwB1L-0005h9-P3 for ged-emacs-devel@m.gmane.org; Tue, 10 Jan 2006 05:22:08 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EwB3J-0008R9-AK for ged-emacs-devel@m.gmane.org; Mon, 09 Jan 2006 23:24:09 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EwB36-0008R4-3a for emacs-devel@gnu.org; Mon, 09 Jan 2006 23:23:56 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EwB34-0008Qs-H2 for emacs-devel@gnu.org; Mon, 09 Jan 2006 23:23:55 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EwB34-0008Qp-CD for emacs-devel@gnu.org; Mon, 09 Jan 2006 23:23:54 -0500 Original-Received: from [209.226.175.188] (helo=tomts25-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EwB5S-0002b1-HT for emacs-devel@gnu.org; Mon, 09 Jan 2006 23:26:22 -0500 Original-Received: from alfajor ([67.71.26.73]) by tomts25-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20060110042151.YZZH25777.tomts25-srv.bellnexxia.net@alfajor>; Mon, 9 Jan 2006 23:21:51 -0500 Original-Received: by alfajor (Postfix, from userid 1000) id 1A378D734B; Mon, 9 Jan 2006 23:21:51 -0500 (EST) Original-To: Lennart Borgman In-Reply-To: <43C2F87B.1030401@student.lu.se> (Lennart Borgman's message of "Tue, 10 Jan 2006 00:57:47 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:48896 Archived-At: >> 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