From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: Assignment of misc packages for emacs Date: Mon, 10 Jun 2002 10:35:54 -0400 Sender: emacs-devel-admin@gnu.org Message-ID: <200206101435.g5AEZto28359@rum.cs.yale.edu> References: <200205050534.g455YfF01634@aztec.santafe.edu> <5xbsbumexh.fsf@kfs2.cua.dk> <200205141941.g4EJfud15293@aztec.santafe.edu> <5xvg9qmgzt.fsf@kfs2.cua.dk> <200205151927.g4FJRRW26103@rum.cs.yale.edu> <5x3cwr4q7m.fsf@kfs2.cua.dk> <87g00rd74y.fsf@tc-1-100.kawasaki.gol.ne.jp> <87sn4otknt.fsf@tc-1-100.kawasaki.gol.ne.jp> <200205191441.g4JEfMg23080@rum.cs.yale.edu> <200205202134.g4KLYHj26031@aztec.santafe.edu> <200205222227.g4MMRIX29393@aztec.santafe.edu> <87g0030xah.fsf@tc-1-100.kawasaki.gol.ne.jp> <200206061204.g56C4qf24692@aztec.santafe.edu> <87r8jka8bm.fsf@tc-1-100.kawasaki.gol.ne.jp> <200206072323.g57NNXU27361@aztec.santafe.edu> <87sn3ypg7b.fsf@tc-1-100.kawasaki.gol.ne.jp> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1023719810 11349 127.0.0.1 (10 Jun 2002 14:36:50 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 10 Jun 2002 14:36:50 +0000 (UTC) Cc: rms@gnu.org, monnier+gnu/emacs@rum.cs.yale.edu, storm@cua.dk, emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17HQHq-0002ww-00 for ; Mon, 10 Jun 2002 16:36:50 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17HQei-00021a-00 for ; Mon, 10 Jun 2002 17:00:28 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17HQHH-0000fe-00; Mon, 10 Jun 2002 10:36:15 -0400 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17HQGx-0000do-00; Mon, 10 Jun 2002 10:35:55 -0400 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id g5AEZto28359; Mon, 10 Jun 2002 10:35:55 -0400 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: Miles Bader Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:4703 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:4703 > It seems to use _multiple_ keymaps (the MAPS and NMAPS parameters), Yes, one might come from the global map, another from the local map, yet others from various minor mode maps. > which it merges to get all the menu entries. Can any explain in what > situation you end up with multiple keymaps that need to be merged like > this? They may all share the same prefix. > Should the lisp function be passed a list of keymaps? I think so, yes. > It would also be nice to have some helper functions/forms to assist lisp > code in manipulating the keymaps without caring too much about the > details. > > For this current application, for instance, I'd like: > > 1) something to iterate over the keymaps > > E.g. perhaps (dobindings (VAR KEYMAP [PREDICATE]) BODY..) XEmacs has map-keymap (and so does lucid.el). CL has cl-map-keymap used internally for the `loop' macro where you can loop over keybindings. `map_keymap' (c|sh)ould also be used internally to avoid exposing the internal representation of keymaps all over keyboard.c. > 2) accessor functions of some sort for the tricky bits > > For menu-items, as I mentioned earlier, there's already this handy > C function `parse_menu_item' which could be used to do the bulk of > the work for any accessor function(s). > > I'm not sure what would be better though, a bunch of individual > accessor functions, e.g., (menu-item-help MENU-ITEM), or one big > accessor function like (menu-item-property MENU-ITEM :help). > > The second would probably be easier to implement, since > parse_menu_item fills in a table, so a general accessor funciton > like `menu-item-property' could just have a list of > keyword->table-index mappings. How about (menu-item-property (parse-menu-item MENU-ITEM) :help) ? Parsing can take a non-negligible time (it can run elisp code among other things) so it would be good to be able to separate it from accessing the actual data. Stefan