Skip to main content

8.4.2 Completion Commands

Here is a list of the completion commands defined in the minibuffer when completion is allowed.

TAB​

Complete the text in the minibuffer as much as possible; if unable to complete, display a list of possible completions (minibuffer-complete).

SPC​

Complete up to one word from the minibuffer text before point (minibuffer-complete-word). This command is not available for arguments that often include spaces, such as file names.

RET​

Submit the text in the minibuffer as the argument, possibly completing first (minibuffer-complete-and-exit). See Completion Exit.

?

Display a list of completions (minibuffer-completion-help).

TAB (minibuffer-complete) is the most fundamental completion command. It searches for all possible completions that match the existing minibuffer text, and attempts to complete as much as it can. See Completion Styles, for how completion alternatives are chosen.

SPC (minibuffer-complete-word) completes like TAB, but only up to the next hyphen or space. If you have ‘auto-f’ in the minibuffer and type SPC, it finds that the completion is ‘auto-fill-mode’, but it only inserts ‘ill-’, giving ‘auto-fill-’. Another SPC at this point completes all the way to ‘auto-fill-mode’.

If TAB or SPC is unable to complete, it displays a list of matching completion alternatives (if there are any) in another window. You can display the same list with ? (minibuffer-completion-help). The following commands can be used with the completion list:

M-v​

PageUp​

prior​

Typing M-v, while in the minibuffer, selects the window showing the completion list (switch-to-completions). This paves the way for using the commands below. PageUp or prior does the same. You can also select the window in other ways (see Windows).

RET​

mouse-1​

mouse-2​

While in the completion list buffer, this chooses the completion at point (choose-completion).

TAB​

While in the completion list buffer, these keys move point to the following completion alternative (next-completion).

S-TAB​

LEFT​

While in the completion list buffer, these keys move point to the previous completion alternative (previous-completion).

q​

While in the completion list buffer, this quits the window showing it and selects the window showing the minibuffer (quit-window).

z​

While in the completion list buffer, kill it and delete the window showing it (kill-current-buffer).