From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: Suggestion: Simple way to make conditional key bindings. Date: Mon, 26 Aug 2002 15:33:01 -0400 Sender: emacs-devel-admin@gnu.org Message-ID: <20020826193301.GA7248@gnu.org> References: <3D49FF140074EFAE@mel-rta7.wanadoo.fr> <5xadnd3eck.fsf@kfs2.cua.dk> <200208231722.g7NHM0M02096@rum.cs.yale.edu> <5xptw6wm2v.fsf@kfs2.cua.dk> <200208261547.g7QFlpA24835@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 1030390464 2674 127.0.0.1 (26 Aug 2002 19:34:24 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 26 Aug 2002 19:34:24 +0000 (UTC) Cc: "Kim F. Storm" , David PONCE , emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17jPd0-0000gw-00 for ; Mon, 26 Aug 2002 21:34:22 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17jQ7y-00043n-00 for ; Mon, 26 Aug 2002 22:06:22 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17jPeF-0006uh-00; Mon, 26 Aug 2002 15:35:39 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17jPbj-0006o0-00 for emacs-devel@gnu.org; Mon, 26 Aug 2002 15:33:03 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17jPbh-0006ne-00 for emacs-devel@gnu.org; Mon, 26 Aug 2002 15:33:03 -0400 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17jPbh-0006nW-00 for emacs-devel@gnu.org; Mon, 26 Aug 2002 15:33:01 -0400 Original-Received: from miles by fencepost.gnu.org with local (Exim 4.10) id 17jPbh-0003HW-00; Mon, 26 Aug 2002 15:33:01 -0400 Original-To: Stefan Monnier Content-Disposition: inline In-Reply-To: <200208261547.g7QFlpA24835@rum.cs.yale.edu> User-Agent: Mutt/1.3.28i Blat: Foop 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:6929 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:6929 On Mon, Aug 26, 2002 at 11:47:50AM -0400, Stefan Monnier wrote: > > The point is that you can install a package - like table.el - which is > > then able to install its own conditional binding on C-y *without* > > interferring with (or even knowning) the standard binding. > > I don't think that's right. I don't believe that table wants to override > C-y sometimes: instead it wants to override `yank' sometimes. > So what you want to do is to create `yank-careful' and then use > either the `remap' thingy or substitute-key-definition or something > like that. I agree strongly with this; I hate packages that rebind common key-bindings with their own `equivalent' version -- naturally they fuck up totally if you've changed the defualt binding, and even when not, such behavior often seems very fragile. Much better is some system like fill-paragraph uses where the generic binding looks for `fill-parapgraph-function' to do the work, which modes can override. Of course such a mechanism only works for a limited set of commands, where it's been established that they are useful to override, and the variable etc. added -- but I think maybe this is a _good_ thing, not a problem, and that we just ought to just make it slightly easier to define such `semantic overrides'. -Miles -- P.S. All information contained in the above letter is false, for reasons of military security.