Most often, the minibuffer is used to read text as a string. It can
also be used to read a Lisp object in textual form. The most basic
primitive for minibuffer input is read-from-minibuffer
; it can do
either one.
In most cases, you should not call minibuffer input functions in the
middle of a Lisp function. Instead, do all minibuffer input as part of
reading the arguments for a command, in the interactive
spec.
See section Defining Commands.
nil
, then it uses
read
to convert the text into a Lisp object (see section Input Functions).
The first thing this function does is to activate a minibuffer and display it with prompt-string as the prompt. This value must be a string.
Then, if initial-contents is a string, read-from-minibuffer
inserts it into the minibuffer, leaving point at the end. The
minibuffer appears with this text as its contents.
The value of initial-contents may also be a cons cell of the form
(string . position)
. This means to insert
string in the minibuffer but put point position characters
from the beginning, rather than at the end.
If keymap is non-nil
, that keymap is the local keymap to
use in the minibuffer. If keymap is omitted or nil
, the
value of minibuffer-local-map
is used as the keymap. Specifying
a keymap is the most important way to customize the minibuffer for
various applications such as completion.
The argument hist specifies which history list variable to use
for saving the input and for history commands used in the minibuffer.
It defaults to minibuffer-history
. See section Minibuffer History.
When the user types a command to exit the minibuffer,
read-from-minibuffer
uses the text in the minibuffer to produce
its return value. Normally it simply makes a string containing that
text. However, if read is non-nil
,
read-from-minibuffer
reads the text and returns the resulting
Lisp object, unevaluated. (See section Input Functions, for information
about reading.)
read-from-minibuffer
. The keymap used is
minibuffer-local-map
.
This is a simplified interface to the
read-from-minibuffer
function:
(read-string prompt initial) == (read-from-minibuffer prompt initial nil nil nil)
exit-minibuffer
exit-minibuffer
abort-recursive-edit
next-history-element
previous-history-element
next-matching-history-element
previous-matching-history-element
read-from-minibuffer
.
This is a simplified interface to the read-from-minibuffer
function, and passes the value of the minibuffer-local-ns-map
keymap as the keymap argument for that function. Since the keymap
minibuffer-local-ns-map
does not rebind C-q, it is
possible to put a space into the string, by quoting it.
(read-no-blanks-input prompt initial) == (read-from-minibuffer prompt initial minibuffer-local-ns-map)
read-no-blanks-input
. By default, it makes the
following bindings, in addition to those of minibuffer-local-map
:
exit-minibuffer
exit-minibuffer
self-insert-and-exit
Go to the first, previous, next, last section, table of contents.