Next: High-Level Completion, Previous: Minibuffer Completion, Up: Completion
This section describes the keymaps, commands and user options used in the minibuffer to do completion. The description refers to the situation when Partial Completion mode is disabled (as it is by default). When enabled, this minor mode uses its own alternatives to some of the commands described below. See Completion Options↗, for a short description of Partial Completion mode.
The value of this variable is the collection used for completion in the minibuffer. This is the global variable that contains what
completing-readpasses totry-completion. It is used by minibuffer completion commands such asminibuffer-complete-word.
This variable's value is the predicate that
completing-readpasses totry-completion. The variable is also used by the other minibuffer completion functions.
When the value of this variable is non-
nil, Emacs asks for confirmation of a completion before exiting the minibuffer.completing-readbinds this variable, and the functionminibuffer-complete-and-exitchecks the value before exiting.
This function completes the minibuffer contents by at most a single word. Even if the minibuffer contents have only one completion,
minibuffer-complete-worddoes not add any characters beyond the first character that is not a word constituent. See Syntax Tables.
This function completes the minibuffer contents, and exits if confirmation is not required, i.e., if
minibuffer-completion-confirmisnil. If confirmation is required, it is given by repeating this command immediately—the command is programmed to work without confirmation when run twice in succession.
This function creates a list of the possible completions of the current minibuffer contents. It works by calling
all-completionsusing the value of the variableminibuffer-completion-tableas the collection argument, and the value ofminibuffer-completion-predicateas the predicate argument. The list of completions is displayed as text in a buffer named `*Completions*'.
This function displays completions to the stream in
standard-output, usually a buffer. (See Read and Print, for more information about streams.) The argument completions is normally a list of completions just returned byall-completions, but it does not have to be. Each element may be a symbol or a string, either of which is simply printed. It can also be a list of two strings, which is printed as if the strings were concatenated. The first of the two strings is the actual completion, the second string serves as annotation.The argument common-substring is the prefix that is common to all the completions. With normal Emacs completion, it is usually the same as the string that was completed.
display-completion-listuses this to highlight text in the completion list for better visual feedback. This is not needed in the minibuffer; for minibuffer completion, you can passnil.This function is called by
minibuffer-completion-help. The most common way to use it is together withwith-output-to-temp-buffer, like this:(with-output-to-temp-buffer "*Completions*" (display-completion-list (all-completions (buffer-string) my-alist) (buffer-string)))
If this variable is non-
nil, the completion commands automatically display a list of possible completions whenever nothing can be completed because the next character is not uniquely determined.
completing-readuses this value as the local keymap when an exact match of one of the completions is not required. By default, this keymap makes the following bindings:
- ?
minibuffer-completion-help- <SPC>
minibuffer-complete-word- <TAB>
minibuffer-completewith other characters bound as in
minibuffer-local-map(see Definition of minibuffer-local-map).
completing-readuses this value as the local keymap when an exact match of one of the completions is required. Therefore, no keys are bound toexit-minibuffer, the command that exits the minibuffer unconditionally. By default, this keymap makes the following bindings:
- ?
minibuffer-completion-help- <SPC>
minibuffer-complete-word- <TAB>
minibuffer-complete- C-j
minibuffer-complete-and-exit- <RET>
minibuffer-complete-and-exitwith other characters bound as in
minibuffer-local-map.
This is like
minibuffer-local-completion-mapexcept that it does not bind <SPC>. This keymap is used by the functionread-file-name.
This is like
minibuffer-local-must-match-mapexcept that it does not bind <SPC>. This keymap is used by the functionread-file-name.
