From unknown Fri Jun 20 07:13:03 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#11716 <11716@debbugs.gnu.org> To: bug#11716 <11716@debbugs.gnu.org> Subject: Status: 24.1; `substitute-command-keys' does not respect `defalias' Reply-To: bug#11716 <11716@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:13:03 +0000 retitle 11716 24.1; `substitute-command-keys' does not respect `defalias' reassign 11716 emacs submitter 11716 "Drew Adams" severity 11716 wishlist tag 11716 wontfix thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 15 14:13:32 2012 Received: (at submit) by debbugs.gnu.org; 15 Jun 2012 18:13:32 +0000 Received: from localhost ([127.0.0.1]:44233 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sfb1X-0002QJ-Ie for submit@debbugs.gnu.org; Fri, 15 Jun 2012 14:13:32 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60864) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sfb1V-0002QC-AI for submit@debbugs.gnu.org; Fri, 15 Jun 2012 14:13:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SfayZ-00034a-4t for submit@debbugs.gnu.org; Fri, 15 Jun 2012 14:10:28 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:56716) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfayZ-00033J-1z for submit@debbugs.gnu.org; Fri, 15 Jun 2012 14:10:27 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49480) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfayX-0002OJ-Ci for bug-gnu-emacs@gnu.org; Fri, 15 Jun 2012 14:10:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SfayU-0002wW-RF for bug-gnu-emacs@gnu.org; Fri, 15 Jun 2012 14:10:24 -0400 Received: from rcsinet15.oracle.com ([148.87.113.117]:21371) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfayU-0002ve-Kr for bug-gnu-emacs@gnu.org; Fri, 15 Jun 2012 14:10:22 -0400 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q5FIAJNu004850 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 15 Jun 2012 18:10:20 GMT Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q5FIAITJ002779 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 15 Jun 2012 18:10:19 GMT Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q5FIAI7l032076 for ; Fri, 15 Jun 2012 13:10:18 -0500 Received: from dradamslap1 (/10.159.184.218) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 15 Jun 2012 11:10:18 -0700 From: "Drew Adams" To: Subject: 24.1; `substitute-command-keys' does not respect `defalias' Date: Fri, 15 Jun 2012 11:10:14 -0700 Message-ID: <60BF0B63E511436DB071C8A9DC519DB5@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: Ac1LIhx5R6khHKE8T72Om84bjQIHeA== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) (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". (substitute-command-keys "\\[foo]") returns "C-d". And if you do (global-set-key "\C-d" 'bar) instead then the problem is the other way around: `M-x...' is shown for `foo'. `substitute-command-keys' should not give the impression that either the command or its alias is not bound to a key when, in effect (for users), it is. In GNU Emacs 24.1.1 (i386-mingw-nt5.1.2600) of 2012-06-10 on MARVIN Windowing system distributor `Microsoft Corp.', version 5.1.2600 Configured using: `configure --with-gcc (4.6) --cflags -ID:/devel/emacs/libs/libXpm-3.5.8/include -ID:/devel/emacs/libs/libXpm-3.5.8/src -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include -ID:/devel/emacs/libs/giflib-4.1.4-1/include -ID:/devel/emacs/libs/jpeg-6b-4/include -ID:/devel/emacs/libs/tiff-3.8.2-1/include -ID:/devel/emacs/libs/gnutls-3.0.9/include' From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 15 16:18:19 2012 Received: (at 11716) by debbugs.gnu.org; 15 Jun 2012 20:18:19 +0000 Received: from localhost ([127.0.0.1]:44341 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SfcyI-0005DV-Qk for submit@debbugs.gnu.org; Fri, 15 Jun 2012 16:18:19 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:53478) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SfcyG-0005DN-9h for 11716@debbugs.gnu.org; Fri, 15 Jun 2012 16:18:17 -0400 Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3WDXxZ4V7Xz4Kh0Z; Fri, 15 Jun 2012 22:15:12 +0200 (CEST) Received: from igel.home (ppp-93-104-149-63.dynamic.mnet-online.de [93.104.149.63]) by mail.mnet-online.de (Postfix) with ESMTPA id 3WDXxX6CbLz4KKKx; Fri, 15 Jun 2012 22:15:12 +0200 (CEST) Received: by igel.home (Postfix, from userid 501) id 43A6ACA2A2; Fri, 15 Jun 2012 22:15:12 +0200 (CEST) From: Andreas Schwab To: "Drew Adams" Subject: Re: bug#11716: 24.1; `substitute-command-keys' does not respect `defalias' References: <60BF0B63E511436DB071C8A9DC519DB5@us.oracle.com> X-Yow: Well, I'm a classic ANAL RETENTIVE!! And I'm looking for a way to VICARIOUSLY experience some reason to LIVE!! Date: Fri, 15 Jun 2012 22:15:12 +0200 In-Reply-To: <60BF0B63E511436DB071C8A9DC519DB5@us.oracle.com> (Drew Adams's message of "Fri, 15 Jun 2012 11:10:14 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 11716 Cc: 11716@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) "Drew Adams" writes: > (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. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 15 17:52:37 2012 Received: (at 11716) by debbugs.gnu.org; 15 Jun 2012 21:52:37 +0000 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 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 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 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 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 Received: from dradamslap1 (/10.159.184.218) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 15 Jun 2012 14:49:31 -0700 From: "Drew Adams" To: "'Andreas Schwab'" References: <60BF0B63E511436DB071C8A9DC519DB5@us.oracle.com> Subject: RE: 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> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: 11716 Cc: 11716@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) > > (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? From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 16 19:45:07 2012 Received: (at 11716) by debbugs.gnu.org; 16 Sep 2012 23:45:07 +0000 Received: from localhost ([127.0.0.1]:37695 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TDOWQ-0005iP-Sh for submit@debbugs.gnu.org; Sun, 16 Sep 2012 19:45:07 -0400 Received: from acsinet15.oracle.com ([141.146.126.227]:24566) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TDOWO-0005iI-Rk for 11716@debbugs.gnu.org; Sun, 16 Sep 2012 19:45:05 -0400 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 q8GNhq36023413 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for <11716@debbugs.gnu.org>; Sun, 16 Sep 2012 23:43:53 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q8GNhqBV013921 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for <11716@debbugs.gnu.org>; Sun, 16 Sep 2012 23:43:52 GMT Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q8GNhqsC013120 for <11716@debbugs.gnu.org>; Sun, 16 Sep 2012 18:43:52 -0500 Received: from dradamslap1 (/10.159.170.142) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 16 Sep 2012 16:43:51 -0700 From: "Drew Adams" To: <11716@debbugs.gnu.org> References: <60BF0B63E511436DB071C8A9DC519DB5@us.oracle.com> <1BBA630250D4412081E924CE95B50D1D@us.oracle.com> Subject: RE: bug#11716: 24.1; `substitute-command-keys' does not respect `defalias' Date: Sun, 16 Sep 2012 16:43:41 -0700 Message-ID: <78BD3DE3537446C5844FC8331047D5F2@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <1BBA630250D4412081E924CE95B50D1D@us.oracle.com> Thread-Index: Ac1LM5URR8eB6KBNQIK3sz4y8SVaPwAC6SjgEkl2szA= X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-Spam-Score: -7.4 (-------) X-Debbugs-Envelope-To: 11716 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -7.4 (-------) ping From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 28 11:46:48 2016 Received: (at 11716) by debbugs.gnu.org; 28 Apr 2016 15:46:48 +0000 Received: from localhost ([127.0.0.1]:53285 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1avo9Q-000627-Jz for submit@debbugs.gnu.org; Thu, 28 Apr 2016 11:46:48 -0400 Received: from hermes.netfonds.no ([80.91.224.195]:58684) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1avo9O-00061z-Kk for 11716@debbugs.gnu.org; Thu, 28 Apr 2016 11:46:47 -0400 Received: from cm-84.215.1.64.getinternet.no ([84.215.1.64] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1avo9L-00043i-J0; Thu, 28 Apr 2016 17:46:45 +0200 From: Lars Ingebrigtsen To: "Drew Adams" Subject: Re: bug#11716: 24.1; `substitute-command-keys' does not respect `defalias' References: <60BF0B63E511436DB071C8A9DC519DB5@us.oracle.com> <1BBA630250D4412081E924CE95B50D1D@us.oracle.com> Date: Thu, 28 Apr 2016 17:46:42 +0200 In-Reply-To: <1BBA630250D4412081E924CE95B50D1D@us.oracle.com> (Drew Adams's message of "Fri, 15 Jun 2012 14:49:27 -0700") Message-ID: <87twilag7x.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 11716 Cc: 'Andreas Schwab' , 11716@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) "Drew Adams" writes: >> > (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. I agree with Andreas. Closing. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 28 11:46:59 2016 Received: (at control) by debbugs.gnu.org; 28 Apr 2016 15:46:59 +0000 Received: from localhost ([127.0.0.1]:53288 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1avo9a-00062W-Qs for submit@debbugs.gnu.org; Thu, 28 Apr 2016 11:46:58 -0400 Received: from hermes.netfonds.no ([80.91.224.195]:58878) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1avo9Y-00062L-SD for control@debbugs.gnu.org; Thu, 28 Apr 2016 11:46:57 -0400 Received: from cm-84.215.1.64.getinternet.no ([84.215.1.64] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1avo9Q-0004AA-Oe for control@debbugs.gnu.org; Thu, 28 Apr 2016 17:46:56 +0200 Date: Thu, 28 Apr 2016 17:46:48 +0200 Message-Id: <87shy5ag7r.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #11716 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) tags 11716 wontfix close 11716 From unknown Fri Jun 20 07:13:03 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 27 May 2016 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator