windows 10, Emacs 25.1, Helm

I open buffer scratch

and execute 3 commands sequence:

  1. M-x I-search
  2. helm-occur
  3. replace-string

here sreenshots: enter image description here enter image description here enter image description here

Nice. It's work fine. But now I want to show in list all of this commands in stack mode.

Smt like this:


And then I want to select one of them (e.g. I-search) and execute them.

How I can do this?


If you are looking to have commands that you previously entered at the M-x prompt available as completion candidates, then Icicles can help.

There are several ways in which you can use completion against candidates from minibuffer histories. One simple one is to use M-h. For example, M-x M-h shows your M-x inputs in buffer *Completions*. You can type text to complete or just cycle to the command you want, etc.

UPDATE to reply to comment question:

You can download Icicles from EmacsWiki. See Downloading Icicles Libraries.

  • Where I can download package "icicles"? In MELPA it not found – a_subscriber Sep 1 '18 at 12:09
  • 1
    @Alexei: Updated answer to provide that info. Thx. – Drew Sep 1 '18 at 14:57

Looks like you already use helm - as you gave the example of helm-occur. Helm comes with helm-minibuffer-history - try

M-x helm-minibuffer-history

The usual way of selecting helm candidates works here too.


There are any number of minibuffer histories, each recording minibuffer input for various calls to completing-read.

You seem to be looking for the history of commands entered at the M-x prompt. Variable extended-command-history records that history. So just use C-h v extended-command-history to see the list in *Help*, or just evaluate extended-command-history in Lisp to get the list.

  • No customizable group, face, or option matching (extended-command-history) – a_subscriber Aug 28 '18 at 7:16
  • Minibuffer history variables, and extended-command-history, are not user options. They are used to record minibuffer input. You or Lisp code can use them (including reset any of them) at any time. C-h v shows a list value for extended-command-history: the commands you invoked using M-x. In the example you cite, you apparently invoked (only) those 4 commands using M-x. – Drew Aug 28 '18 at 13:58
  • I want to select command from list (like helm do). Not like this: extended-command-history is a variable defined in ‘simple.el’. Its value is ("helm-occur" "yafolding-hide-element" "json-pretty-print" "yafolding-show-element" "highlight-symbol-remove-all" "magit-status" "customize-variable" "rename-buffer" "magit-list-repositories" "new-frame") – a_subscriber Aug 28 '18 at 15:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.