From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: substitute-key-definition vs. define-key MAP [remap ...] Date: Fri, 23 Jul 2010 00:36:02 +0200 Message-ID: References: <871vb517a6.fsf@mithlond.arda> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1279840613 23768 80.91.229.12 (22 Jul 2010 23:16:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 22 Jul 2010 23:16:53 +0000 (UTC) Cc: emacs-devel@gnu.org To: Teemu Likonen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 23 01:16:51 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 1Oc50V-0006gc-6E for ged-emacs-devel@m.gmane.org; Fri, 23 Jul 2010 01:16:51 +0200 Original-Received: from localhost ([127.0.0.1]:42784 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oc4xM-0007o5-E1 for ged-emacs-devel@m.gmane.org; Thu, 22 Jul 2010 19:13:36 -0400 Original-Received: from [140.186.70.92] (port=56859 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oc4NF-0004gT-J7 for emacs-devel@gnu.org; Thu, 22 Jul 2010 18:36:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oc4N5-0001n4-9M for emacs-devel@gnu.org; Thu, 22 Jul 2010 18:36:11 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:34440) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oc4N5-0001ml-6h for emacs-devel@gnu.org; Thu, 22 Jul 2010 18:36:07 -0400 Original-Received: from ceviche.home (vpn-132-204-232-69.acd.umontreal.ca [132.204.232.69]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id o6MMa20Y008534; Thu, 22 Jul 2010 18:36:03 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 16ED8660D2; Fri, 23 Jul 2010 00:36:02 +0200 (CEST) In-Reply-To: <871vb517a6.fsf@mithlond.arda> (Teemu Likonen's message of "Thu, 15 Jul 2010 11:25:05 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3584=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:127663 Archived-At: > So, am I right in saying that using substitute-key-definition on global > map directly is a bad practice? Yes and no. Part of the reason why it exists is because that code was written before remap was available. Another part is because I'm not sure remap is available in XEmacs, so packages who want to work in XEmacs may prefer not to use it. Finally, in some cases, using remap is not the right answer either because remap not only replaces the command at its "usual" key-bindings, but at all its key-bindings, which means that the user has no way to access the original command other than via M-x (she can't make her own key-binding for it, for instance). So remap can only be used when the remapped command really makes the original command undesirable. Stefan