(emacs)Minibuffer History

Next: Repetition Prev: Completion Up: Minibuffer

Minibuffer History

   Every argument that you enter with the minibuffer is saved on a
"minibuffer history list" so that you can use it again later in another
argument.  Special commands load the text of an earlier argument in the
minibuffer.  They discard the old minibuffer contents, so you can think
of them as moving through the history of previous arguments.

     Move to the next earlier argument string saved in the minibuffer
     history (`previous-history-element').

     Move to the next later argument string saved in the minibuffer
     history (`next-history-element').

     Move to an earlier saved argument in the minibuffer history that
     has a match for REGEXP (`previous-matching-history-element').

     Move to a later saved argument in the minibuffer history that has a
     match for REGEXP (`next-matching-history-element').

   The simplest way to reuse the saved arguments in the history list is
to move through the history list one element at a time.  While in the
minibuffer, type `M-p' (`previous-history-element') to "move to" the
next earlier minibuffer input, and use `M-n' (`next-history-element')
to "move to" the next later input.

   The previous input that you fetch from the history entirely replaces
the contents of the minibuffer.  To use it as the argument, exit the
minibuffer as usual with RET.  You can also edit the text before you
reuse it; this does not change the history element that you "moved" to,
but your new argument does go at the end of the history list in its own

   There are also commands to search forward or backward through the
history.  As of this writing, they search for history elements that
match a regular expression that you specify with the minibuffer.  `M-r'
(`previous-matching-history-element') searches older elements in the
history, while `M-s' (`next-matching-history-element') searches newer
elements.  By special dispensation, these commands can use the
minibuffer to read their arguments even though you are already in the
minibuffer when you issue them.

   All uses of the minibuffer record your input on a history list, but
there are separate history lists for different kinds of input.  For
example, there is a list for file names, used by all the commands that
read file names.  There is a list for arguments of commands like
`query-replace'.  There are also very specific history lists, including
one for command names read by M-x and one for compilation commands read
by `compile'.  Finally, there is one "miscellaneous" history list that
most minibuffer arguments use.

automatically generated by info2www