Emacs: How do I change the "Mx" prompt to something else?

I have execute-extended-command

one related to alt + a. So when in the minibuffer, when I hit it, the read-only saying "Mx" doesn't matter to me. I want to change it to something else like "execute command:". How can i do this?

+3


source to share


2 answers


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.

+6


source


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

+5


source







All Articles