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: Thu, 11 Jul 2002 13:13:10 -0400 Sender: emacs-devel-admin@gnu.org Message-ID: <200207111713.g6BHDAO03283@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> <200207101043.g6AAhMZ14976@aztec.santafe.edu> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1026410880 22449 127.0.0.1 (11 Jul 2002 18:08:00 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 11 Jul 2002 18:08:00 +0000 (UTC) Cc: monnier+gnu/emacs@rum.cs.yale.edu, miles@lsi.nec.co.jp, 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 17SiMC-0005py-00 for ; Thu, 11 Jul 2002 20:08:00 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17SiVh-0000Fm-00 for ; Thu, 11 Jul 2002 20:17:49 +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 17SiMn-0001Kf-00; Thu, 11 Jul 2002 14:08:37 -0400 Original-Received: from delysid.gnu.org ([158.121.106.20]) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17SiK9-0000ai-00; Thu, 11 Jul 2002 14:05:53 -0400 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by delysid.gnu.org with esmtp (Exim 3.34 #2) id 17ShVA-0005AI-00; Thu, 11 Jul 2002 13:13:12 -0400 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id g6BHDAO03283; Thu, 11 Jul 2002 13:13:10 -0400 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: Richard Stallman 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:5663 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:5663 > Also there > is the issue of eliminating/merging duplicate bindings, which I think > XEmacs' code punts on by declaring that `map-keymap' does not look at > the keymap's parent(s). > > By duplicate bindings do you mean shadowed bindings? Both shadowed bindings and bindings which are both prefixes (such that the first doesn't completely shadow the second). > I think that if you ask for "scan the parents", by default you should > get all the bindings, including shadowed bindings. However, there > could be an optional feature to ignore shadowed bindings. What do you mean by "ignore" ? Does that mean that if I do (let ((map (make-spase-keymap))) (set-keymap-marent map global-map) (define-key map "\C-x" (make-sparse-keymap))) I'might never see any of the C-x bindings in `global-map' ? > That is not > terribly hard to do. Just do a lookup for that event type, and see if > the binding that it reports is the one you have in hand. I think that > there is already code to do this, probably in where-is-internal. Lookup is O(N) and it would be done for every binding in the keymap, so it might be easy but algorithmically expensive. In the case of where-is-internal it's OK because it's done once after scanning the whole keymap anyway. > As for merging of subkeymaps, you don't have to worry about that. > read-key-sequence implicitly merges the keymaps that it gets for a > prefix key, when it gets them from different maps. But it does not > merge the prefix definition from one map A with prefix definitions > from its parent B. That is handled by making the prefix binding found > in map A have as its parent the prefix binding found in map B. > In other words, for scanning parents, you don't have to do anything > special when the binding is a keymap. Of course, I know about the fix_submap_inheritance kludge. But the problem is that it might not have been executed yet, so maybe map_keymap would need to do it. Also what about merging `menu-item's ? Should they be merged ? Stefan