Here are some variables that can be used to alter the default completion behavior.
The value of this variable is a list of completion style (symbols) to use for performing completion. A completion style is a set of rules for generating completions. Each symbol occurring this list must have a corresponding entry in
This variable stores a list of available completion styles. Each element in the list has the form(style try-completion all-completions doc)
Here, style is the name of the completion style (a symbol), which may be used in the
completion-stylesvariable to refer to this style; try-completion is the function that does the completion; all-completions is the function that lists the completions; and doc is a string describing the completion style.
The try-completion and all-completions functions should each accept four arguments: string, collection, predicate, and point. The string, collection, and predicate arguments have the same meanings as in
try-completion(see Basic Completion), and the point argument is the position of point within string. Each function should return a non-
nilvalue if it performed its job, and
nilif it did not (e.g., if there is no way to complete string according to the completion style).
When the user calls a completion command like
minibuffer-complete(see Completion Commands), Emacs looks for the first style listed in
completion-stylesand calls its try-completion function. If this function returns
nil, Emacs moves to the next listed completion style and calls its try-completion function, and so on until one of the try-completion functions successfully performs completion and returns a non-
nilvalue. A similar procedure is used for listing completions, via the all-completions functions.
See Completion Styles, for a description of the available completion styles.
This variable specifies special completion styles and other completion behaviors to use when completing certain types of text. Its value should be an alist with elements of the form
). category is a symbol describing what is being completed; currently, the
unicode-namecategories are defined, but others can be defined via specialized completion functions (see Programmed Completion). alist is an association list describing how completion should behave for the corresponding category. The following alist keys are supported:
- The value should be a list of completion styles (symbols).
- The value should be a value for
completion-cycle-threshold(see Completion Options) for this category.
Additional alist entries may be defined in the future.
This variable is used to specify extra properties of the current completion command. It is intended to be let-bound by specialized completion commands. Its value should be a list of property and value pairs. The following properties are supported:
- The value should be a function to add annotations in the completions buffer. This function must accept one argument, a completion, and should either return
nilor a string to be displayed next to the completion.
- The value should be a function to run after performing completion. The function should accept two arguments, string and status, where string is the text to which the field was completed, and status indicates what kind of operation happened:
finishedif text is now complete,
soleif the text cannot be further completed but completion is not finished, or
exactif the text is a valid completion but may be further completed.