GNU bug report logs - #1525
prompt string for execute-extended-command not flexible

Previous Next

Package: emacs;

Reported by: xah lee <xah <at> xahlee.org>

Date: Tue, 9 Dec 2008 22:45:03 UTC

Severity: minor

Tags: notabug

Done: Lars Magne Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 1525 in the body.
You can then email your comments to 1525 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#1525; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to xah lee <xah <at> xahlee.org>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: xah lee <xah <at> xahlee.org>
To: bug-gnu-emacs <at> gnu.org
Subject: prompt string for execute-extended-command not flexible
Date: Tue, 9 Dec 2008 14:36:36 -0800
The prompt string for execute-extended-command is “M-x ”, but that  
is not correct if the command is bound to some other key by  
customization.

Kevin Rodgers gave this explanation recently in “gnu.emacs.help”:

«
seber...@spawar.navy.mil wrote:
> When you type a command in Emacs you are greeted with the prompt "M-
> x".  How change that prompt string?

Change this code in src/keyboard.c and recompile emacs:
   /* This isn't strictly correct if execute-extended-command
      is bound to anything else.  Perhaps it should use
      this_command_keys?  */
   strcat (buf, "M-x ");
-- 
Kevin Rodgers
»

So, possibly the promp can be changed to “Execute command ”.

Thanks.

  Xah
∑ http://xahlee.org/

Severity set to `minor' from `normal' Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Wed, 10 Dec 2008 02:30:04 GMT) Full text and rfc822 format available.

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#1525; Package emacs. (Sun, 10 Jul 2011 13:17:01 GMT) Full text and rfc822 format available.

Message #10 received at 1525 <at> debbugs.gnu.org (full text, mbox):

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: xah lee <xah <at> xahlee.org>
Cc: 1525 <at> debbugs.gnu.org
Subject: Re: prompt string for execute-extended-command not flexible
Date: Sun, 10 Jul 2011 15:15:51 +0200
xah lee <xah <at> xahlee.org> writes:

> The prompt string for execute-extended-command is “M-x ”, but that is
> not correct if the command is bound to some other key by
> customization.
>
> Kevin Rodgers gave this explanation recently in “gnu.emacs.help”:
>
> «
> seber...@spawar.navy.mil wrote:
>> When you type a command in Emacs you are greeted with the prompt "M-
>> x".  How change that prompt string?
>
> Change this code in src/keyboard.c and recompile emacs:
>    /* This isn't strictly correct if execute-extended-command
>       is bound to anything else.  Perhaps it should use
>       this_command_keys?  */
>    strcat (buf, "M-x ");

This is no longer done, but it's still not quite right.

If you do:

(local-set-key [(meta z)] 'execute-extended-command)

Then you still get "M-x" as the prompt if you do `M-z'.

The reason is that it looks up the command first, and then picks one of
the bindings as the description, with code that's kinda like this:

(key-description (car (where-is-internal 'execute-extended-command)))

Is there any reason it doesn't just use this_command_keys which
presumably would be more correct?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#1525; Package emacs. (Tue, 12 Jul 2011 03:21:01 GMT) Full text and rfc822 format available.

Message #13 received at 1525 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
Cc: xah lee <xah <at> xahlee.org>, 1525 <at> debbugs.gnu.org
Subject: Re: bug#1525: prompt string for execute-extended-command not flexible
Date: Mon, 11 Jul 2011 23:20:35 -0400
Lars Magne Ingebrigtsen <larsi <at> gnus.org> writes:

> (local-set-key [(meta z)] 'execute-extended-command)
>
> Then you still get "M-x" as the prompt if you do `M-z'.
>
> The reason is that it looks up the command first, and then picks one of
> the bindings as the description, with code that's kinda like this:
>
> (key-description (car (where-is-internal 'execute-extended-command)))
>
> Is there any reason it doesn't just use this_command_keys which
> presumably would be more correct?

OTOH, you might get into a tricky situation if execute-extended-command
was launched by, say, a mouse event.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#1525; Package emacs. (Tue, 12 Jul 2011 03:43:01 GMT) Full text and rfc822 format available.

Message #16 received at 1525 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
Cc: xah lee <xah <at> xahlee.org>, 1525 <at> debbugs.gnu.org
Subject: Re: bug#1525: prompt string for execute-extended-command not flexible
Date: Mon, 11 Jul 2011 23:41:59 -0400
> (key-description (car (where-is-internal 'execute-extended-command)))
> Is there any reason it doesn't just use this_command_keys which
> presumably would be more correct?

Actually the problem is that it should never have said "M-x " but rather
"Run command: ".  From this viewpoint, there's no need to use
this_command_keys: "M-x" is really only meant to be "the canonical
key-binding for this command", so (key-description (car
(where-is-internal 'execute-extended-command))) works as well.
Otherwise if someone happens to hit the "menu" key without realizing
that it's bound to execute-extended-command he might start wonder "OK
the menu bar says 'menu ' what do I do now?", whereas presumably with
"M-x " the user sees "oh that runs the same command as M-x, cool".


        Stefan




Added tag(s) notabug. Request was from Lars Magne Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 12 Jul 2011 08:52:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 1525 <at> debbugs.gnu.org and xah lee <xah <at> xahlee.org> Request was from Lars Magne Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 12 Jul 2011 08:52:02 GMT) Full text and rfc822 format available.

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#1525; Package emacs. (Tue, 12 Jul 2011 08:53:01 GMT) Full text and rfc822 format available.

Message #23 received at 1525 <at> debbugs.gnu.org (full text, mbox):

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: xah lee <xah <at> xahlee.org>, 1525 <at> debbugs.gnu.org
Subject: Re: bug#1525: prompt string for execute-extended-command not flexible
Date: Tue, 12 Jul 2011 10:51:15 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> Actually the problem is that it should never have said "M-x " but rather
> "Run command: ".  From this viewpoint, there's no need to use
> this_command_keys: "M-x" is really only meant to be "the canonical
> key-binding for this command", so (key-description (car
> (where-is-internal 'execute-extended-command))) works as well.
> Otherwise if someone happens to hit the "menu" key without realizing
> that it's bound to execute-extended-command he might start wonder "OK
> the menu bar says 'menu ' what do I do now?", whereas presumably with
> "M-x " the user sees "oh that runs the same command as M-x, cool".

Right.  So I'm closing this report, since this isn't really a bug.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 09 Aug 2011 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 320 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.