From unknown Wed Jun 18 23:13:04 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#29399 <29399@debbugs.gnu.org> To: bug#29399 <29399@debbugs.gnu.org> Subject: Status: 26.0.90; `edit-kbd-macro' has bad prompt Reply-To: bug#29399 <29399@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:13:04 +0000 retitle 29399 26.0.90; `edit-kbd-macro' has bad prompt reassign 29399 emacs submitter 29399 Drew Adams severity 29399 minor tag 29399 fixed patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 22 11:27:40 2017 Received: (at submit) by debbugs.gnu.org; 22 Nov 2017 16:27:41 +0000 Received: from localhost ([127.0.0.1]:52949 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHXsC-0000VF-LW for submit@debbugs.gnu.org; Wed, 22 Nov 2017 11:27:40 -0500 Received: from eggs.gnu.org ([208.118.235.92]:55367) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHXsB-0000Uy-5J for submit@debbugs.gnu.org; Wed, 22 Nov 2017 11:27:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eHXs5-0007I2-4P for submit@debbugs.gnu.org; Wed, 22 Nov 2017 11:27:34 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:60142) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eHXs5-0007Hv-1l for submit@debbugs.gnu.org; Wed, 22 Nov 2017 11:27:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46331) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHXs3-0004OP-UI for bug-gnu-emacs@gnu.org; Wed, 22 Nov 2017 11:27:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eHXs0-0007Gw-QI for bug-gnu-emacs@gnu.org; Wed, 22 Nov 2017 11:27:31 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:31048) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eHXs0-0007GO-HJ for bug-gnu-emacs@gnu.org; Wed, 22 Nov 2017 11:27:28 -0500 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id vAMGRR1D005320 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 22 Nov 2017 16:27:27 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id vAMGRPV6003910 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 22 Nov 2017 16:27:26 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id vAMGRPWl026435 for ; Wed, 22 Nov 2017 16:27:25 GMT MIME-Version: 1.0 Message-ID: <4fea6ba6-0003-4422-97d6-51098197b1eb@default> Date: Wed, 22 Nov 2017 08:27:23 -0800 (PST) From: Drew Adams To: bug-gnu-emacs@gnu.org Subject: 26.0.90; `edit-kbd-macro' has bad prompt X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4615.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit 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: -5.0 (-----) emacs -Q C-x ( C-f C-f C-f C-x ) M-: (global-set-key (kbd "C-o") 'execute-extended-command) M-: (global-set-key (kbd "M-x") 'forward-char) C-o edit-kbd-macro RET The prompt says: "Keyboard macro to edit (C-x e, M-x, C-h l, or keys):" It should use \\[execute-extended-command] and thus say: "Keyboard macro to edit (C-x e, C-o, C-h l, or keys):" This prompt is anyway not clear. The command should instead accept a key sequence that shows more complete info/help, and the prompt should just mention that key sequence. In GNU Emacs 26.0.90 (build 3, x86_64-w64-mingw32) of 2017-10-13 built on LAPHROAIG Repository revision: 906224eba147bdfc0514090064e8e8f53160f1d4 Windowing system distributor 'Microsoft Corp.', version 6.1.7601 Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Defining kbd macro... Keyboard macro defined Quit [2 times] execute-extended-command forward-char Quit Configured using: 'configure --without-dbus --host=3Dx86_64-w64-mingw32 --without-compress-install 'CFLAGS=3D-O2 -static -g3'' Configured features: XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS Important settings: value of $LANG: ENU locale-coding-system: cp1252 From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 22 19:13:52 2017 Received: (at 29399) by debbugs.gnu.org; 23 Nov 2017 00:13:52 +0000 Received: from localhost ([127.0.0.1]:53214 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHf9H-0005Lh-Nh for submit@debbugs.gnu.org; Wed, 22 Nov 2017 19:13:52 -0500 Received: from mail-it0-f42.google.com ([209.85.214.42]:38411) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHf9G-0005LT-G6 for 29399@debbugs.gnu.org; Wed, 22 Nov 2017 19:13:46 -0500 Received: by mail-it0-f42.google.com with SMTP id n134so8379248itg.3 for <29399@debbugs.gnu.org>; Wed, 22 Nov 2017 16:13:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=n7IsjhWhSEFLW27WFG302+ExlMowgfhigXGLDJgzIn8=; b=g72pD3PpFdPXZ/N8YUDfdRaR2oYoPsck+WVvPOH4bEV3oDDMFMXTgLyv7IxN4OqbY3 hSXr/cwA8KDxQk5jEN7I+Bb1sWR7DQznrx3SxKjGkEk9P29tfBwfUNUwIPJGck4NUQ5U VB4GmWweneV3aIMLUqJFkqt+mJeUpiu9tXGnjC0pe+a53osBID1Ro87povOGCG+LPPQX aQ6taN4E9YLH9bUHMtfp0O08M23jX+ZO/xGl7hY5ZbPHawyuSmOGlpum/rG0htRrO55N BAgciEB5VQ/chS4MBwUHegnjqCmBz7FHnKNl2J2UnDXlhlETrqFEOJ9FBrZ69ThXKzwG 1UCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=n7IsjhWhSEFLW27WFG302+ExlMowgfhigXGLDJgzIn8=; b=IVm7Qgc0OIx3RhVfzYfuzLBOLRzunGhCZKEyDMUc3SwSP59kqzlb1NZ7C2syyFyGjH iEV2uAlLp2UWD/rUjiE483EsT0tuAAth7IO8GH/WW9JeOh9CQZLwmAaACvxBRO2HMNSH Su1+rJTyCGgJ863m0bAUt+hB9PLOs8sktU4BNEXJCLFx+bZJfXDtluXBJxoEUuTOChy9 SYuHhle6sX7i1sAUTYAFcVh0NpWHUG3qMyjwprplmCK5DGTZ4QbuTQsppT8orDLQC8L3 gp0uYQadwHj9s3mXsPIafIVCxEyQMQG+1aLW4J3WUxYXTCIlYow5H2wFS9kLfQ9eeFCu 2Cqw== X-Gm-Message-State: AJaThX6nO9tmd2ERMWNefj66W1/FCw9Dx+ybPWeORSYTrQUtmW38I18m Kz+jegS757L9kx98FRaQbjyTsw== X-Google-Smtp-Source: AGs4zMaiGZwZiYcIM0+YJmdkAvq8srwrn1NR87DiqD+X0NKr0Za4ABR5G5+To36RYtX2ziqNobLM+g== X-Received: by 10.36.28.81 with SMTP id c78mr9215691itc.96.1511396020641; Wed, 22 Nov 2017 16:13:40 -0800 (PST) Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id 23sm2587726itj.15.2017.11.22.16.13.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 22 Nov 2017 16:13:39 -0800 (PST) From: Noam Postavsky To: Drew Adams Subject: Re: bug#29399: 26.0.90; `edit-kbd-macro' has bad prompt References: <4fea6ba6-0003-4422-97d6-51098197b1eb@default> Date: Wed, 22 Nov 2017 19:13:38 -0500 In-Reply-To: <4fea6ba6-0003-4422-97d6-51098197b1eb@default> (Drew Adams's message of "Wed, 22 Nov 2017 08:27:23 -0800 (PST)") Message-ID: <87y3mxzwb1.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 29399 Cc: 29399@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.2 (/) Drew Adams writes: > emacs -Q > > C-x ( C-f C-f C-f C-x ) > > M-: (global-set-key (kbd "C-o") 'execute-extended-command) > M-: (global-set-key (kbd "M-x") 'forward-char) > > C-o edit-kbd-macro RET > > The prompt says: > > "Keyboard macro to edit (C-x e, M-x, C-h l, or keys):" > > It should use \\[execute-extended-command] and thus say: > > "Keyboard macro to edit (C-x e, C-o, C-h l, or keys):" > > This prompt is anyway not clear. The command should instead accept > a key sequence that shows more complete info/help, and the prompt should > just mention that key sequence. I'm not sure if this would help so much for the OP's case [1], which is more like: (defun my/execute-extended-command () ; actually `smex'[2] in OP's case (interactive) (call-interactively 'execute-extended-command)) (global-set-key (kbd "M-x") 'my/execute-extended-command) With that kind of config, I get Keyboard macro to edit (C-x e, , C-h l, or keys): I have no idea how to produce on my keyboard. If also do (define-key global-map [execute] 'ignore) I get Keyboard macro to edit (C-x e, , C-h l, or keys): which I know is the "Menu key" [3]. But personally, I disable the key also, because otherwise I sometimes accidentally lean on it, producing deeply nested minibuffer prompt which is annoying. (define-key global-map [menu] 'ignore) Which ends up with this: "Keyboard macro to edit (C-x e, M-x execute-extended-command, C-h l, or keys):" [1]: https://emacs.stackexchange.com/questions/37017/unable-to-supply-macro-name-to-edit-kbd-macro-when-m-x-is-bound-to-smex [2]: https://github.com/nonsequitur/smex [3]: https://en.wikipedia.org/wiki/Menu_key From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 22 20:16:06 2017 Received: (at 29399) by debbugs.gnu.org; 23 Nov 2017 01:16:06 +0000 Received: from localhost ([127.0.0.1]:53231 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHg7a-0006p3-GR for submit@debbugs.gnu.org; Wed, 22 Nov 2017 20:16:06 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:49196) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHg7Y-0006oI-T1 for 29399@debbugs.gnu.org; Wed, 22 Nov 2017 20:16:05 -0500 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id vAN1Fvxl008896 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 Nov 2017 01:15:57 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id vAN1FtLj021537 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 Nov 2017 01:15:55 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id vAN1FsZ5008820; Thu, 23 Nov 2017 01:15:55 GMT MIME-Version: 1.0 Message-ID: Date: Wed, 22 Nov 2017 17:15:53 -0800 (PST) From: Drew Adams To: Noam Postavsky Subject: RE: bug#29399: 26.0.90; `edit-kbd-macro' has bad prompt References: <4fea6ba6-0003-4422-97d6-51098197b1eb@default> <87y3mxzwb1.fsf@users.sourceforge.net> In-Reply-To: <87y3mxzwb1.fsf@users.sourceforge.net> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4615.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 29399 Cc: 29399@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: -2.3 (--) > > It should use \\[execute-extended-command] and thus say: > > "Keyboard macro to edit (C-x e, C-o, C-h l, or keys):" >=20 > I'm not sure if this would help so much for the OP's case [1], which is > more like: >=20 > (defun my/execute-extended-command () ; actually `smex'[2] in OP's > case > (interactive) > (call-interactively 'execute-extended-command)) > (global-set-key (kbd "M-x") 'my/execute-extended-command) >=20 > With that kind of config, I get > Keyboard macro to edit (C-x e, , C-h l, or keys): Well, that's at least correct. ;-) The problem is that there is no way to tell Emacs which binding to show. I suppose you could use `set-advertised-calling-convention', but a user shouldn't need to bother (or know about) that, here. This is a general Emacs gotcha/problem. It's not the problem of this bug report. Except for this, which I also said: >> This prompt is anyway not clear. The command should >> instead accept a key sequence that shows more complete >> info/help, and the prompt should just mention that key >> sequence. That's the right thing to do. The prompt shouldn't try to mention lots of keys. That's only good when the command itself will actually read keys - it then knows just which keys to mention: those it uses. This command should mention only (at most) a help key that it provides (would provide). Using that help key (at that time - while prompted) would show whatever help we want to show, including mentioning any keys or commands, if appropriate. Of course that help could itself fall into the problem of showing a key such as `' or `'. But as I said, that's a general problem. It could choose to mention only command names, i.e., not use \\[...]. > I have no idea how to produce on my keyboard. You probably cannot. > Which ends up with this: >=20 > "Keyboard macro to edit (C-x e, M-x execute-extended-command, C-h l, > or keys):" And that's as good as it could get. The command can reasonably assume that you can use `execute-extended-command' (which you can, I think, regardless of whether `M-x' is bound to `smex'). The command cannot know that a user always wants to use `smex' instead of `M-x'. UNLESS the user (or `smex-mode' or whatever) actually substitutes `smex' for `execute-extended-command' keys, using remapping or using `substitute-key-definition'. From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 26 19:55:30 2017 Received: (at 29399) by debbugs.gnu.org; 27 Nov 2017 00:55:30 +0000 Received: from localhost ([127.0.0.1]:59799 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJ7ho-0002um-Fm for submit@debbugs.gnu.org; Sun, 26 Nov 2017 19:55:28 -0500 Received: from mail-it0-f46.google.com ([209.85.214.46]:41831) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJ7hl-0002uT-Re; Sun, 26 Nov 2017 19:55:26 -0500 Received: by mail-it0-f46.google.com with SMTP id x28so18972871ita.0; Sun, 26 Nov 2017 16:55:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version; bh=qgzLhDbQnlgC7MiCBzjHXVVIzwjCoLIr7OISj0gKz9I=; b=s7ULaXp0nbft9BGv/8D4M4Gdf7a+D4CX7LW5YmTTep3lQSYGdU+T/JQfogHP/Y7cjp 0BxLgUmt5Ytj1BuFRySouhzECDKdIwCeL+bLLZ8rcLJimjuLgGa4ybWZb5fGrmwqj8lP 7YX4TGRvgF5Y6Ng3XL6X8LKhFKwO0W/o35gLDMwwfK5omb+B+Gm3C2c90IEM6qiPfyaC XwwJdvP51jRu5fY22TwwQ5azZbTFHzgaZmbMSjKKSrtrAa9G3fsLEteFUjPu5idHY1hO 8wTiBKhKYEEI7EpKYhfX8J65upkx/l0VY9ipYxkHrWuJa7WK1ZO7UMyFBlVtupUgjlqw 3s9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version; bh=qgzLhDbQnlgC7MiCBzjHXVVIzwjCoLIr7OISj0gKz9I=; b=OIIaU/KGokQwMNNqfhri1rmvnafeEC5V6vOwmjUg7ympUoZO/tG3Qaxkn/GHZFoZH/ ytmLzrMOdKLAUbiopLZj5ufBVwJ/EVvPhjWiBEzmikYVxhF4cqEjPh0zfWK8xs3qi0bo /rvwIe/INBEzFSizrJw1dFoWqGV4Lig2mbb0DrcU5+t/3qKwz5BBpSwc+mh82klSnK26 3ZttQQH2+z1jSrMRAi80Nps8vbbCxuWcXZpFSWPV2mfpGzupJfTk446rEumW9edVCgLI 0ErUzfPfgHHH2kZX+0qFrW+HgRJD4/d1oWblafFFzHf8FvGIpo4X/crXWkO+wjDcU+5z h1Eg== X-Gm-Message-State: AJaThX7SdLEXb5bXMF495gcaudvcEINkIRfQeLENf+QoS/TV6HcBJ2z3 idi0vtEckw6lMhedhbGukfY3Aw== X-Google-Smtp-Source: AGs4zMbmC4Xq4W9/6yP/eK27KevM9qfbFHyjZ+rf7aGoENSY6hlJUYbmdMp2o026BmUoiQRkSyt6KA== X-Received: by 10.36.148.134 with SMTP id j128mr25761097ite.17.1511744119759; Sun, 26 Nov 2017 16:55:19 -0800 (PST) Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id c36sm8981650iod.11.2017.11.26.16.55.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Nov 2017 16:55:17 -0800 (PST) From: Noam Postavsky To: Drew Adams Subject: Re: bug#29399: 26.0.90; `edit-kbd-macro' has bad prompt In-Reply-To: (Drew Adams's message of "Wed, 22 Nov 2017 17:15:53 -0800 (PST)") References: <4fea6ba6-0003-4422-97d6-51098197b1eb@default> <87y3mxzwb1.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) Date: Sun, 26 Nov 2017 19:55:11 -0500 Message-ID: <87efoko80g.fsf@users.sourceforge.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 29399 Cc: 29399@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.1 (/) --=-=-= Content-Type: text/plain tags 29399 + patch quit Drew Adams writes: > UNLESS the user (or `smex-mode' or whatever) actually > substitutes `smex' for `execute-extended-command' keys, > using remapping or using `substitute-key-definition'. Ah, I didn't realize before, but if you do (define-key global [remape execute-extended-command] 'smex) then substitute-command-keys still shows M-x for \\[execute-extended-command]. The following patch updates the prompt, and also the checks non-remapped key bindings for the key sequence entered. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Improve-edit-kbd-macro-prompting-in-case-of-remapped.patch Content-Description: patch >From dec6f0ccf57ea590c199b6cdf39c6fe93d67d06b Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 26 Nov 2017 19:16:16 -0500 Subject: [PATCH] Improve edit-kbd-macro prompting in case of remapped keys (Bug#29399) * lisp/edmacro.el (edit-kbd-macro): Use substitute-command-keys to present the current bindings in the prompt. Check the the non-remapped binding of the entered key sequence as well. --- lisp/edmacro.el | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/lisp/edmacro.el b/lisp/edmacro.el index b050f4d64c..dc840ef1f1 100644 --- a/lisp/edmacro.el +++ b/lisp/edmacro.el @@ -88,20 +88,26 @@ edmacro-original-buffer (defun edit-kbd-macro (keys &optional prefix finish-hook store-hook) "Edit a keyboard macro. At the prompt, type any key sequence which is bound to a keyboard macro. -Or, type `C-x e' or RET to edit the last keyboard macro, `C-h l' to edit -the last 300 keystrokes as a keyboard macro, or `\\[execute-extended-command]' to edit a macro by -its command name. +Or, type `\\[kmacro-end-and-call-macro]' or RET to edit the last +keyboard macro, `\\[view-lossage]' to edit the last 300 +keystrokes as a keyboard macro, or `\\[execute-extended-command]' +to edit a macro by its command name. With a prefix argument, format the macro in a more concise way." - (interactive "kKeyboard macro to edit (C-x e, M-x, C-h l, or keys): \nP") + (interactive + (list (read-key-sequence (substitute-command-keys "Keyboard macro to edit \ +\(\\[kmacro-end-and-call-macro], \\[execute-extended-command], \\[view-lossage],\ + or keys): ")) + current-prefix-arg)) (when keys (let ((cmd (if (arrayp keys) (key-binding keys) keys)) + (cmd-noremap (when (arrayp keys) (key-binding keys nil t))) (mac nil) (mac-counter nil) (mac-format nil) kmacro) (cond (store-hook (setq mac keys) (setq cmd nil)) - ((or (memq cmd '(call-last-kbd-macro kmacro-call-macro - kmacro-end-or-call-macro kmacro-end-and-call-macro)) + ((or (memq cmd '(call-last-kbd-macro kmacro-call-macro kmacro-end-or-call-macro kmacro-end-and-call-macro)) + (memq cmd-noremap '(call-last-kbd-macro kmacro-call-macro kmacro-end-or-call-macro kmacro-end-and-call-macro)) (member keys '("\r" [return]))) (or last-kbd-macro (y-or-n-p "No keyboard macro defined. Create one? ") @@ -109,13 +115,14 @@ edit-kbd-macro (setq mac (or last-kbd-macro "")) (setq keys nil) (setq cmd 'last-kbd-macro)) - ((eq cmd 'execute-extended-command) + ((memq 'execute-extended-command (list cmd cmd-noremap)) (setq cmd (read-command "Name of keyboard macro to edit: ")) (if (string-equal cmd "") (error "No command name given")) (setq keys nil) (setq mac (symbol-function cmd))) - ((memq cmd '(view-lossage electric-view-lossage)) + ((or (memq cmd '(view-lossage electric-view-lossage)) + (memq cmd-noremap '(view-lossage electric-view-lossage))) (setq mac (recent-keys)) (setq keys nil) (setq cmd 'last-kbd-macro)) -- 2.11.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 02 09:55:02 2017 Received: (at control) by debbugs.gnu.org; 2 Dec 2017 14:55:02 +0000 Received: from localhost ([127.0.0.1]:41097 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eL9C1-00017j-QY for submit@debbugs.gnu.org; Sat, 02 Dec 2017 09:55:01 -0500 Received: from mail-it0-f44.google.com ([209.85.214.44]:41994) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eL9C0-00017U-M7; Sat, 02 Dec 2017 09:55:00 -0500 Received: by mail-it0-f44.google.com with SMTP id p139so5548332itb.1; Sat, 02 Dec 2017 06:55:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=xmW7IbBvYsBjo4alJRcTD+MGvI0EmVTqxlBoNeXKkA4=; b=kGAE1Ofy5OhT0Fmj5sOcmsqdZ0E382vyl8gPsAMuP70Dow/eRCR1jdrRqsOR1DDiMA mkJdRFKHEofYSVHjJLHvt/u8MlWaHQ+Vr3qQDrCJDc2F078rsD+1rwVqMqF6mspIbtw/ v6p+1eVJ96HgsxTAcvhkNOoVdNRTVnyFq9qMZGjrnqHGBne7RToq60hRgK81VPKmblD/ vNgySBSlzPQnOp8hIRG11rh8ruTExj1mKqsYYiWk2Idc4MpXPxpGxF/QuheLtn7OztXv ZUllUzMYO6Zk/UeTZNSDoDrI3AIeE+rol7lvre0YJfCTcVm0VQA3cB8iRpZRHK1cUg+f 3qiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=xmW7IbBvYsBjo4alJRcTD+MGvI0EmVTqxlBoNeXKkA4=; b=kHG9RhDWY4+LFKfqVfVf13NDbIf+0E78R6egcmg9cLxB4u+t3Z84wXX9pEjXRhImyX mPNfiqmk7jFTFItDvUrUofAd8ApgiavDntjXr3QgKaFqtWceiXg9PUVHV22q+RRjBW7V tLz+ICdIJueVJzKQJ63VZlr71dRurc6hEwx+mHXmxZx5NP9vRl2i2S7vTaH81juVHxWI k4DmflcOiQGT+DB8RJ3ZLzJr2Hruw93gCx/8QABq6Pv5KVjeP0TntUpMoR9hv960OZG+ 2Sv9ol7EdtE7bR5OstY6NVxxvGY9IEaGb2hNu3rM+U/sXPXOC+60lZAzc3WKICyKB8mJ xWvw== X-Gm-Message-State: AJaThX78W3YjyAxGx9qNA+VWpC1pM9zKcaX0h64j780hlPV3gx3qlMl5 1rrGQ/GXvEdxyKa1PPsdZWnWMQ== X-Google-Smtp-Source: AGs4zMarwSZ9LjnEscIw+DBQxP4PBMozkJmvyXCbXepzfETNUbf9WwERZ/lHjQLFmzy64K+i+ct9FA== X-Received: by 10.36.47.204 with SMTP id j195mr5921009itj.98.1512226494821; Sat, 02 Dec 2017 06:54:54 -0800 (PST) Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id z8sm1692680itc.41.2017.12.02.06.54.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 02 Dec 2017 06:54:53 -0800 (PST) From: Noam Postavsky To: Drew Adams Subject: Re: bug#29399: 26.0.90; `edit-kbd-macro' has bad prompt References: <4fea6ba6-0003-4422-97d6-51098197b1eb@default> <87y3mxzwb1.fsf@users.sourceforge.net> <87efoko80g.fsf@users.sourceforge.net> Date: Sat, 02 Dec 2017 09:54:52 -0500 In-Reply-To: <87efoko80g.fsf@users.sourceforge.net> (Noam Postavsky's message of "Sun, 26 Nov 2017 19:55:11 -0500") Message-ID: <87fu8tji2r.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control Cc: 29399@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 (/) tags 29399 fixed close 29399 26.1 quit Noam Postavsky writes: > The following patch updates the prompt, and also the checks > non-remapped key bindings for the key sequence entered. Pushed to emacs-26. [1: 98ca7d5f26]: 2017-12-02 09:35:44 -0500 Improve edit-kbd-macro prompting in case of remapped keys (Bug#29399) https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=98ca7d5f26f5bdde44864c7f24dafb6725fca09f From unknown Wed Jun 18 23:13:04 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 31 Dec 2017 12:24:04 +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