From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#11716: 24.1; `substitute-command-keys' does not respect `defalias' Date: Fri, 15 Jun 2012 14:49:27 -0700 Message-ID: <1BBA630250D4412081E924CE95B50D1D@us.oracle.com> References: <60BF0B63E511436DB071C8A9DC519DB5@us.oracle.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1339797007 16172 80.91.229.3 (15 Jun 2012 21:50:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 15 Jun 2012 21:50:07 +0000 (UTC) Cc: 11716@debbugs.gnu.org To: "'Andreas Schwab'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 15 23:50:06 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SfeP7-0002kA-Sv for geb-bug-gnu-emacs@m.gmane.org; Fri, 15 Jun 2012 23:50:06 +0200 Original-Received: from localhost ([::1]:45659 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfeP7-0002EQ-Rw for geb-bug-gnu-emacs@m.gmane.org; Fri, 15 Jun 2012 17:50:05 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47982) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfeP5-0002D5-1f for bug-gnu-emacs@gnu.org; Fri, 15 Jun 2012 17:50:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SfeP3-0008My-De for bug-gnu-emacs@gnu.org; Fri, 15 Jun 2012 17:50:02 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34869) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfeP3-0008Md-9d for bug-gnu-emacs@gnu.org; Fri, 15 Jun 2012 17:50:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SfeRx-0007LC-Hv for bug-gnu-emacs@gnu.org; Fri, 15 Jun 2012 17:53:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 Jun 2012 21:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11716 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11716-submit@debbugs.gnu.org id=B11716.133979715728186 (code B ref 11716); Fri, 15 Jun 2012 21:53:01 +0000 Original-Received: (at 11716) by debbugs.gnu.org; 15 Jun 2012 21:52:37 +0000 Original-Received: from localhost ([127.0.0.1]:44415 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SfeRY-0007KZ-Om for submit@debbugs.gnu.org; Fri, 15 Jun 2012 17:52:37 -0400 Original-Received: from acsinet15.oracle.com ([141.146.126.227]:51284) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SfeRX-0007KS-3q for 11716@debbugs.gnu.org; Fri, 15 Jun 2012 17:52:35 -0400 Original-Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q5FLnW6o014234 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 15 Jun 2012 21:49:33 GMT Original-Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q5FLnW3m000753 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 15 Jun 2012 21:49:32 GMT Original-Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q5FLnVEg032493; Fri, 15 Jun 2012 16:49:31 -0500 Original-Received: from dradamslap1 (/10.159.184.218) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 15 Jun 2012 14:49:31 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: Ac1LM5URR8eB6KBNQIK3sz4y8SVaPwAC6Sjg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:61031 Archived-At: > > (defun foo () "foo" (interactive) (message "FOO")) > > (defalias 'bar 'foo) > > (global-set-key "\C-d" 'foo) > > (substitute-command-keys "\\[bar]") > > > > The last sexp returns "M-x bar". It should return "C-d". > > No. C-d is not bound to bar. No what? I didn't say it was. C-d is, _in effect_, that is, from a user perspective, bound to `bar'. It is not bound to `bar' but the effect is that it invokes the code that `bar' runs. `substitute-command-keys' is used most often in doc strings and such, communicating to users what they can use to invoke particular commands etc. It is far more useful to let a user know that s?he can use C-d than it is to just punt and say "M-x bar". If a programmer explicitly wants to choose "M-x bar" over letting users know they can use C-d, s?he can use "M-x bar" and not "\\[bar]". And yes, the user CAN use C-d, because of the binding of C-d to `foo' and the defalias of `bar' to `foo'. What's important here is what users can do, not whether `bar' is actually bound to C-d. Do you have a counter use case? A typical use of `substitute-command-keys' (or even an atypical case) where fixing this would cause a problem? A case where the user should see a distinction between `foo' and `bar' wrt key bindings?