From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel 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 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1160443935 7769 80.91.229.2 (10 Oct 2006 01:32:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 10 Oct 2006 01:32:15 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 10 03:32:13 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 1GX6Tb-00048S-PW for ged-emacs-devel@m.gmane.org; Tue, 10 Oct 2006 03:32:12 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GX6Tb-0002X4-2H for ged-emacs-devel@m.gmane.org; Mon, 09 Oct 2006 21:32:11 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GX6TJ-0002VS-Bc for emacs-devel@gnu.org; Mon, 09 Oct 2006 21:31:53 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GX6TH-0002T6-2d for emacs-devel@gnu.org; Mon, 09 Oct 2006 21:31:52 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GX6TG-0002T3-Sc for emacs-devel@gnu.org; Mon, 09 Oct 2006 21:31:50 -0400 Original-Received: from [141.146.126.228] (helo=agminet01.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GX6av-0006Xl-Ka for emacs-devel@gnu.org; Mon, 09 Oct 2006 21:39:46 -0400 Original-Received: from rgmsgw01.us.oracle.com (rgmsgw01.us.oracle.com [138.1.186.51]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id k9A1VlGP009614 for ; Mon, 9 Oct 2006 20:31:47 -0500 Original-Received: from dradamslap (dhcp-amer-whq-csvpn-gw3-141-144-83-154.vpn.oracle.com [141.144.83.154]) by rgmsgw01.us.oracle.com (Switch-3.2.4/Switch-3.2.4) with SMTP id k9A1VkMN027071 for ; Mon, 9 Oct 2006 19:31:47 -0600 Original-To: "Emacs-Devel" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Importance: Normal X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE 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:60566 Archived-At: > 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.