From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Uday S Reddy Newsgroups: gmane.emacs.devel Subject: Re: Key bindings proposal Date: Mon, 2 Aug 2010 11:58:20 +0100 Message-ID: <19542.42188.177000.850266@gargle.gargle.HOWL> References: <19534.1494.627000.357123@gargle.gargle.HOWL> <19537.40472.267000.563053@gargle.gargle.HOWL> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1280746734 18870 80.91.229.12 (2 Aug 2010 10:58:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 2 Aug 2010 10:58:54 +0000 (UTC) Cc: Uday S Reddy , emacs-devel@gnu.org To: Stuart Hacking Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 02 12:58:50 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OfsjI-0004Hs-Vd for ged-emacs-devel@m.gmane.org; Mon, 02 Aug 2010 12:58:49 +0200 Original-Received: from localhost ([127.0.0.1]:47194 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OfsjH-0000FF-5Y for ged-emacs-devel@m.gmane.org; Mon, 02 Aug 2010 06:58:47 -0400 Original-Received: from [140.186.70.92] (port=38350 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OfsjA-0000FA-9v for emacs-devel@gnu.org; Mon, 02 Aug 2010 06:58:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ofsj9-000155-18 for emacs-devel@gnu.org; Mon, 02 Aug 2010 06:58:40 -0400 Original-Received: from sun61.bham.ac.uk ([147.188.128.150]:34966) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ofsj8-00014g-PE for emacs-devel@gnu.org; Mon, 02 Aug 2010 06:58:38 -0400 Original-Received: from [147.188.128.127] (helo=bham.ac.uk) by sun61.bham.ac.uk with esmtp (Exim 4.67) (envelope-from ) id 1Ofsj4-0000fw-Op; Mon, 02 Aug 2010 11:58:34 +0100 Original-Received: from mx1.cs.bham.ac.uk ([147.188.192.53]) by bham.ac.uk with esmtp (Exim 4.43) id 1Ofsj4-0007nj-Et; Mon, 02 Aug 2010 11:58:34 +0100 Original-Received: from gromit.cs.bham.ac.uk ([147.188.193.16] helo=MARUTI.cs.bham.ac.uk) by mx1.cs.bham.ac.uk with esmtp (Exim 4.51) id 1Ofsj3-0007hg-R1; Mon, 02 Aug 2010 11:58:33 +0100 In-Reply-To: X-Mailer: VM 8.1.92a under 23.2.1 (i386-mingw-nt5.1.2600) X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:128098 Archived-At: Stuart Hacking writes: > To me, this sounds a lot like personal preference. I already have an > emacs-lisp file full of global and mode specific keybindings and > another with some convenience defaliases. These make sense for the way > I work, but I'm sure they would be completely inappropriate for > certain other users. Excellent. The only "personal" thing I see about it is that you might have picked aliases based on personal preference. But there is no reason why the concept of giving such aliases is personal. That is a generally useful idea. > Is your suggestion to automatically alias functions by the current > major mode? (by, for example, removing the prefix? (dired-do-isearch > -> isearch)) Indeed, that is one part of the suggestion. The part 2 of the suggestion is to allow key bindings for such aliases, which would then be widely applicable across several modes. > Or, do you want a simple method of aliasing commands across modes? How > would this work? > > (define-multi-alias 'isearch > ('dired-mode 'dired-do-isearch) > ... > ... > (t 'isearch)) Do you mean you already have such an aliasing scheme? I suppose one can dispatch on the major mode. That is neat! It is not a general solution, of course, since it is based on a closed world assumption about what modes one needs to deal with. But it is a good starting point. > the 'architecture' that I use is a combination of `defalias', > `add-hook', and `define-key' in my personal init files. Am I doing > something wrong? So, I suppose you will let dired-mode do all its self-righteous key bindings and then use a hook to overwrite all of them with your own key bindings? I think I am beginning to like this software-as-the-enemy principle! Cheers, Uday