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: Enhancements to "minor-mode-map-alist" functionality. Date: Fri, 12 Apr 2002 16:30:08 -0400 Sender: emacs-devel-admin@gnu.org Message-ID: <200204122030.g3CKU8P17707@rum.cs.yale.edu> References: <5xbscpg7zl.fsf@kfs2.cua.dk> <200204112243.g3BMhmI01190@rum.cs.yale.edu> <5xd6x5i7ps.fsf@kfs2.cua.dk> <200204121820.g3CIKkA16739@rum.cs.yale.edu> <5xy9fsocfg.fsf@kfs2.cua.dk> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1018643600 6281 127.0.0.1 (12 Apr 2002 20:33:20 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 12 Apr 2002 20:33:20 +0000 (UTC) Cc: "Stefan Monnier" , 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 16w7jU-0001dC-00 for ; Fri, 12 Apr 2002 22:33:20 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 16w7zu-00015R-00 for ; Fri, 12 Apr 2002 22:50:18 +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 16w7jG-0003py-00; Fri, 12 Apr 2002 16:33:06 -0400 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16w7gQ-00025n-00 for ; Fri, 12 Apr 2002 16:30:10 -0400 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id g3CKU8P17707; Fri, 12 Apr 2002 16:30:08 -0400 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: storm@cua.dk (Kim F. Storm) 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:2602 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:2602 > But I still think the use of the minor-mode-overriding-map-alist for > this purpose is pretty obscure (although I suspect that is the > purpose for which it was invented...) I still think it's the best solution so far. Better than a `keymap' text-property (help-follow also works on non-buttons and I care about it, since I wrote the code for it ;-). > > > Also, the keymap lookup code would also have to be careful not to > > > interpret the FUN part as a binding, > > > > You can force it to be a symbol. > > I would prefer not to do that; an alternative would be to put a > cons cell (:filter . FORM) into the keymap, causing the rest of > the keymap to be ignored if FORM returns nil. Note that if the evaluation is done inside get_keymap then there is no problem whatsoever and the map can have any shape we want (the only reason to start it with `keymap' is convenience, for instance). > I would be much easier if an element in the minor-mode-map-alist > could be tagged as `keep at head of list'. IIRC we discussed this > some time ago on this list, and really didn't find a way to > accomplish that. Indeed, it would be easy to do in add-minor-mode and define-minor-mode or with a watcher, but in the current context, it seems hopeless. Although you could of course write a general post-command-hook that does what you want and that both cua and viper could use. > But maybe such modes could simply put their map on > minor-mode-overriding-map-alist instead ? Is that "legal practice"? I don't think there's anything illegal about it, but since that variable is automatically made buffer-local, it will also require some care, although it shouldn't be too bad. Stefan