Previous: Strict Completion, Up: Completion


9.3.4 Completion Options

When completion is done on file names, certain file names are usually ignored. The variable completion-ignored-extensions contains a list of strings; a file whose name ends in any of those strings is ignored as a possible completion. The standard value of this variable has several elements including ".o", ".elc", ".dvi" and "~". The effect is that, for example, ‘foo’ can complete to ‘foo.c’ even though ‘foo.o’ exists as well. However, if all the possible completions end in “ignored” strings, then they are not ignored. Ignored extensions do not apply to lists of completions—those always mention all possible completions.

If an element of the list in completion-ignored-extensions ends in a slash /, it indicates a subdirectory that should be ignored when completing file names. (Elements of completion-ignored-extensions which do not end in a slash are never considered when a completion candidate is a directory; thus, completion returns directories whose names end in .elc even though there's an element ".elc" in the list.)

Normally, a completion command that cannot determine even one additional character automatically displays a list of all possible completions. If the variable completion-auto-help is set to nil, this automatic display is disabled, so you must type ? to display the list of completions.

Partial Completion mode implements a more powerful kind of completion that can complete multiple words in parallel. For example, it can complete the command name abbreviation p-b into print-buffer, because no other command starts with two words whose initials are ‘p’ and ‘b’.

Partial completion of directories in file names uses ‘*’ to indicate the places for completion; thus, /u*/b*/f* might complete to /usr/bin/foo.

To enable this mode, use the command M-x partial-completion-mode, or customize the variable partial-completion-mode. This binds the partial completion commands to <TAB>, <SPC>, <RET>, and ?. The usual completion commands are available on M-<TAB> (or C-M-i), M-<SPC>, M-<RET> and M-?.

Another feature of Partial Completion mode is to extend find-file so that ‘<include>’ stands for the file named include in some directory in the path PC-include-file-path. If you set PC-disable-includes to non-nil, this feature is disabled.

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 M-x icomplete-mode.