A minibuffer history list records previous minibuffer inputs so the user can reuse them conveniently. A history list is actually a symbol, not a list; it is a variable whose value is a list of strings (previous inputs), most recent first.
There are many separate history lists, used for different kinds of inputs. It's the Lisp programmer's job to specify the right history list for each use of the minibuffer.
The basic minibuffer input functions read-from-minibuffer
and
completing-read
both accept an optional argument named hist
which is how you specify the history list. Here are the possible
values:
If you don't specify hist, then the default history list
minibuffer-history
is used. For other standard history lists,
see below. You can also create your own history list variable; just
initialize it to nil
before the first use.
Both read-from-minibuffer
and completing-read
add new
elements to the history list automatically, and provide commands to
allow the user to reuse items on the list. The only thing your program
needs to do to use a history list is to initialize it and to pass its
name to the input functions when you wish. But it is safe to modify the
list by hand when the minibuffer input functions are not using it.
Here are some of the standard minibuffer history list variables:
query-replace
(and similar
arguments to other commands).
Go to the first, previous, next, last section, table of contents.