Emacs: How do I change the "Mx" prompt to something else?
This prompt is hardcoded. You need to either override read-extended-command
or be advised completing-read
(but this seems like a rather weak approach).
Cm. M-x find-function
RET read-extended-command
RET
The code has comments related to this very topic:
;; This isn't strictly correct if `execute-extended-command'
;; is bound to anything else (e.g. [menu]).
;; It could use (key-description (this-single-command-keys)),
;; but actually a prompt other than "M-x" would be confusing,
;; because "M-x" is a well-known prompt to read a command
;; and it serves as a shorthand for "Extended command: ".
Honestly, given the lack of a clean solution, I wouldn't try to do this.
source to share
Check out smex which is a built-in improvement execute-extended-command
; it allows you to customize the prompt using a variable smex-prompt-string
.
Or, if you have the Emacs source installed, you can go straight to the implementation: just M-x find-function
RET execute-extended-command
RET
source to share