From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Stephen J. Turnbull" Newsgroups: gmane.emacs.devel Subject: Re: substitute-key-definition vs. define-key MAP [remap ...] Date: Fri, 23 Jul 2010 12:50:03 +0900 Message-ID: <87aapiyhzo.fsf@uwakimon.sk.tsukuba.ac.jp> 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 1279857159 25791 80.91.229.12 (23 Jul 2010 03:52:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 23 Jul 2010 03:52:39 +0000 (UTC) Cc: Teemu Likonen , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 23 05:52:38 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 1Oc9JN-0003Vb-Ej for ged-emacs-devel@m.gmane.org; Fri, 23 Jul 2010 05:52:37 +0200 Original-Received: from localhost ([127.0.0.1]:38698 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oc9JM-0007sl-M3 for ged-emacs-devel@m.gmane.org; Thu, 22 Jul 2010 23:52:36 -0400 Original-Received: from [140.186.70.92] (port=48546 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oc9JI-0007sQ-4m for emacs-devel@gnu.org; Thu, 22 Jul 2010 23:52:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oc9Fx-0001tA-4A for emacs-devel@gnu.org; Thu, 22 Jul 2010 23:49:06 -0400 Original-Received: from mtps01.sk.tsukuba.ac.jp ([130.158.97.223]:54436) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oc9Fw-0001sn-S0 for emacs-devel@gnu.org; Thu, 22 Jul 2010 23:49:05 -0400 Original-Received: from uwakimon.sk.tsukuba.ac.jp (uwakimon.sk.tsukuba.ac.jp [130.158.99.156]) by mtps01.sk.tsukuba.ac.jp (Postfix) with ESMTP id 431461535A8; Fri, 23 Jul 2010 12:49:03 +0900 (JST) Original-Received: by uwakimon.sk.tsukuba.ac.jp (Postfix, from userid 1000) id 982621A26DF; Fri, 23 Jul 2010 12:50:03 +0900 (JST) In-Reply-To: X-Mailer: VM 8.0.12-devo-585 under 21.5 (beta29) "garbanzo" ed3b274cc037 XEmacs Lucid (x86_64-unknown-linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:127667 Archived-At: Stefan Monnier writes: > > 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. It's not available in XEmacs. I haven't thought carefully about it, but my initial reaction is to oppose introducing it. It adds a lot of complexity (an additional layer of indirection), and like `substitute-key-definition', it postpones the real solution to issues that create demand for these features: rewrite the function so that it can be configured by users, modes, etc. > 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, If I understand you correctly, that won't get into XEmacs any time soon. Do you really mean that `define-key' is allowed to effectively change the command binding of a symbol globally, so that its function definition is ignored in the context of interpreting keystrokes? Ie, `define-key' now turns Emacs into what is effectively a LISP-3?