@c This is part of the Emacs manual.
-@c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2012
-@c Free Software Foundation, Inc.
+@c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2015 Free Software
+@c Foundation, Inc.
@c See file emacs.texi for copying conditions.
@node Minibuffer
@chapter The Minibuffer
use the usual Emacs editing commands in the minibuffer to edit the
argument text.
+@menu
+* Basic Minibuffer:: Basic usage of the minibuffer.
+* Minibuffer File:: Entering file names with the minibuffer.
+* Minibuffer Edit:: How to edit in the minibuffer.
+* Completion:: An abbreviation facility for minibuffer input.
+* Minibuffer History:: Reusing recent minibuffer arguments.
+* Repetition:: Re-executing commands that used the minibuffer.
+* Passwords:: Entering passwords in the echo area.
+* Yes or No Prompts:: Replying yes or no in the echo area.
+@end menu
+
+@node Basic Minibuffer
+@section Using the Minibuffer
+
@cindex prompt
When the minibuffer is in use, it appears in the echo area, with a
-cursor. The minibuffer starts with a @dfn{prompt} in a distinct
-color, usually ending with a colon. The prompt states what kind of
-input is expected, and how it will be used.
+cursor. The minibuffer starts with a @dfn{prompt}, usually ending
+with a colon. The prompt states what kind of input is expected, and
+how it will be used. The prompt is highlighted using the
+@code{minibuffer-prompt} face (@pxref{Faces}).
The simplest way to enter a minibuffer argument is to type the text,
-then @key{RET} to submit the argument and exit the minibuffer. You
-can cancel the minibuffer, and the command that wants the argument, by
-typing @kbd{C-g}.
+then @key{RET} to submit the argument and exit the minibuffer.
+Alternatively, you can type @kbd{C-g} to exit the minibuffer by
+canceling the command asking for the argument (@pxref{Quitting}).
@cindex default argument
- Sometimes, a @dfn{default argument} appears in the prompt, inside
+ Sometimes, the prompt shows a @dfn{default argument}, inside
parentheses before the colon. This default will be used as the
argument if you just type @key{RET}. For example, commands that read
buffer names usually show a buffer name as the default; you can type
@key{RET} to operate on that default buffer.
+@cindex Minibuffer Electric Default mode
+@cindex mode, Minibuffer Electric Default
+@findex minibuffer-electric-default-mode
+@vindex minibuffer-eldef-shorten-default
+ If you enable Minibuffer Electric Default mode, a global minor mode,
+Emacs hides the default argument as soon as you modify the contents of
+the minibuffer (since typing @key{RET} would no longer submit that
+default). If you ever bring back the original minibuffer text, the
+prompt again shows the default. Furthermore, if you change the
+variable @code{minibuffer-eldef-shorten-default} to a non-@code{nil}
+value, the default argument is displayed as @samp{[@var{default}]}
+instead of @samp{(default @var{default})}, saving some screen space.
+To enable this minor mode, type @kbd{M-x
+minibuffer-electric-default-mode}.
+
Since the minibuffer appears in the echo area, it can conflict with
other uses of the echo area. If an error message or an informative
message is emitted while the minibuffer is active, the message hides
the minibuffer comes back. While the minibuffer is in use, keystrokes
do not echo.
-@menu
-* Minibuffer File:: Entering file names with the minibuffer.
-* Minibuffer Edit:: How to edit in the minibuffer.
-* Completion:: An abbreviation facility for minibuffer input.
-* Minibuffer History:: Reusing recent minibuffer arguments.
-* Repetition:: Re-executing commands that used the minibuffer.
-* Passwords:: Entering passwords in the echo area.
-* Yes or No Prompts:: Replying yes or no in the echo area.
-@end menu
-
@node Minibuffer File
@section Minibuffers for File Names
point (@code{choose-completion}).
@findex next-completion
-@item @key{Right}
+@item @key{RIGHT}
While in the completion list buffer, this moves point to the following
completion alternative (@code{next-completion}).
@findex previous-completion
-@item @key{Left}
+@item @key{LEFT}
While in the completion list buffer, this moves point to the previous
completion alternative (@code{previous-completion}).
@end table
disregards @code{completion-ignored-extensions} when showing
completion alternatives in the completion list.
+ Shell completion is an extended version of filename completion,
+@pxref{Shell Options}.
+
@vindex completion-auto-help
If @code{completion-auto-help} is set to @code{nil}, the completion
commands never display the completion list buffer; you must type
numeric value @var{n}, completion commands switch to this cycling
behavior only when there are @var{n} or fewer alternatives.
-@cindex Icomplete mode
-@findex icomplete-mode
- Icomplete mode presents a constantly-updated display that tells you
-what completions are available for the text you've entered so far. The
-command to enable or disable this minor mode is @kbd{M-x
-icomplete-mode}.
-
@node Minibuffer History
@section Minibuffer History
@cindex minibuffer history
@table @kbd
@item M-p
-@itemx @key{Up}
+@itemx @key{UP}
Move to the previous item in the minibuffer history, an earlier
argument (@code{previous-history-element}).
@item M-n
-@itemx @key{Down}
+@itemx @key{DOWN}
Move to the next item in the minibuffer history
(@code{next-history-element}).
@item M-r @var{regexp} @key{RET}
@kindex DOWN @r{(minibuffer history)}
@findex next-history-element
@findex previous-history-element
- While in the minibuffer, @kbd{M-p} or @key{Up}
+ While in the minibuffer, @kbd{M-p} or @key{UP}
(@code{previous-history-element}) moves through the minibuffer history
list, one item at a time. Each @kbd{M-p} fetches an earlier item from
the history list into the minibuffer, replacing its existing contents.
-Typing @kbd{M-n} or @key{Down} (@code{next-history-element}) moves
+Typing @kbd{M-n} or @key{DOWN} (@code{next-history-element}) moves
through the minibuffer history list in the opposite direction,
fetching later entries into the minibuffer.