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: looking up a submenu keymap in a menu keymap, when the submenu key is a string Date: Mon, 09 Oct 2006 01:07:30 -0400 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1160370475 13054 80.91.229.2 (9 Oct 2006 05:07:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 9 Oct 2006 05:07:55 +0000 (UTC) Cc: Emacs-Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 09 07:07:53 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 1GWnMl-0004Ua-F2 for ged-emacs-devel@m.gmane.org; Mon, 09 Oct 2006 07:07:51 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GWnMk-0003Ic-Vj for ged-emacs-devel@m.gmane.org; Mon, 09 Oct 2006 01:07:51 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GWnMU-0003HL-2o for emacs-devel@gnu.org; Mon, 09 Oct 2006 01:07:34 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GWnMT-0003Ge-8o for emacs-devel@gnu.org; Mon, 09 Oct 2006 01:07:33 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GWnMS-0003GJ-Pu for emacs-devel@gnu.org; Mon, 09 Oct 2006 01:07:32 -0400 Original-Received: from [209.226.175.4] (helo=tomts16-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GWnTw-0001xc-Jb for emacs-devel@gnu.org; Mon, 09 Oct 2006 01:15:16 -0400 Original-Received: from pastel.home ([70.53.194.105]) by tomts16-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20061009050730.OTGR27612.tomts16-srv.bellnexxia.net@pastel.home> for ; Mon, 9 Oct 2006 01:07:30 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 2F56A8098; Mon, 9 Oct 2006 01:07:30 -0400 (EDT) Original-To: "Drew Adams" In-Reply-To: (Drew Adams's message of "Sun\, 8 Oct 2006 18\:27\:36 -0700") 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:60538 Archived-At: > 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"]), This can work, but the test is `eq' rather than `equal' so you have to pass not just some random "Variables" string, but the very one used in the keymap. > 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. I think easy-menu is the way to go. Tell us what you tried. Of course, it may also be important to know the context in which you're doing that: maybe there's a simpler way. > 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. It's definitely not encouraged, but it should mostly be irrelevant, because it's an internal issue. Normally, either you have the key already (from read-key-sequence, for example), or you have the menu entry name (in which case you have to use code such as the one used in easy-menu to scan the keymap and recover the corresponding key). Stefan