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: What happened to the key-menu patch? Date: Wed, 10 Jul 2002 14:12:52 -0400 Sender: emacs-devel-admin@gnu.org Message-ID: <200207101812.g6AICqA31949@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> <5xn0t3p362.fsf_-_@kfs2.cua.dk> <200207091358.g69Dwlr26999@rum.cs.yale.edu> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1026324770 1871 127.0.0.1 (10 Jul 2002 18:12:50 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 10 Jul 2002 18:12:50 +0000 (UTC) Cc: "Stefan Monnier" , storm@cua.dk (Kim F. Storm), rms@gnu.org, 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 17SLxJ-0000U4-00 for ; Wed, 10 Jul 2002 20:12:49 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17SM6L-0001HT-00 for ; Wed, 10 Jul 2002 20:22:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17SLxt-0004b0-00; Wed, 10 Jul 2002 14:13:25 -0400 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17SLxV-0004Zc-00; Wed, 10 Jul 2002 14:13:01 -0400 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id g6AICqA31949; Wed, 10 Jul 2002 14:12:52 -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.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:5632 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:5632 > > > sure if it's worth it to add a `dobindings' macro or not. > > Agreed. There's already a `loop' macro for it in CL. > Yeah, but we don't really like cl in emacs, remember? Oh wait, you do. Indeed, I do. And `loop' is a macro so it only needs CL at compile-time which is usually regarded as OK. > > > key-description list' is, but it's something like (meta control x). > > > I guess this is a canonical format for key names in xemacs, but it > > > doesn't appear to be so in emacs, so I'm not sure how that argument > > > should be handled (perhaps just punt, and pass whatever's stored in > > > the keymap). > > > > I don't think we should try to re-create the XEmacs (meta control x) form > > from our M-C-x symbols. We could provide an additional compatibility layer > > on top of it, if it proves useful/necessary later on. > > So, just pass whatever's stored in the keymap directly? Yes. > > > (2) How are menu entries handled with this? > > > > As for how we should treat them, I think we should not do anything > > special with them: i.e. `function' will be called with key `menu-bar' > > and with the corresponding sub-keymap as the binding. > > That would be consistent with `lookup-key', but it also throws out > a bunch of useful information for menu-entries -- in particular, the > very information that I want for the key-menus! > > How about just passing something similar to the corresponding arguments > to define-key, Yes, that's exactly what I meant and what my code does. > e.g., for keys, `function' would be the function, but > for menu-entries, it would be the whole (menu-item ...) list. Yes, but I said `menu-bar' and the thing bound to `menu-bar' is usually just a keymap because the menubar itself has no name: only entries inside the keymap bound to `menu-bar' will have `menu-item' thingies. > Either way, we have to provide some other sort of function to allow > easily going from one form to the other -- if we just pass the > function/sub-keymap, there needs to be a way for the user to lookup all > the menu-item information, and if we pass the (menu-item...) list > directly, there should probably be some access function(s) to make > getting at the various pieces cleanly. Of course, we need to export some kind of parse-menu-item function, as was discussed a few weeks/months back. > Perhaps the thing to do is to pass only the function/sub-keymap by > default, but have an optional argument that says `pass all menu info for > menu-items'; this could possible be combined with Richard's suggestion > of having an option to suppress passing menu-items altogether. I think it's better to just pas the menu-items all the time: we'll need the parse-menu-item functionality anyway. > We could (rather, should) add a similar optional argument to > `lookup-key' for conistency and utility. I have also thought about it, but the need has never arisen (not even in the C code). Stefan