Minor copyedits of completion-at-point-functions documentation

* lisp/minibuffer.el (completion-at-point-functions):
* doc/lispref/minibuf.texi (Completion in Buffers): Fix wording
and filling.

(cherry picked from commit a8ddd05d7d)
This commit is contained in:
Eli Zaretskii 2018-04-01 12:19:49 +03:00
parent 748f0fdd5a
commit 9fee1b8fb3
2 changed files with 17 additions and 14 deletions

View file

@ -1877,10 +1877,11 @@ are used to compute a completion table for completing the text at
point. It can be used by major modes to provide mode-specific point. It can be used by major modes to provide mode-specific
completion tables (@pxref{Major Mode Conventions}). completion tables (@pxref{Major Mode Conventions}).
When the command @code{completion-at-point} runs, it calls the functions in the When the command @code{completion-at-point} runs, it calls the
list one by one, without any argument. Each function should return @code{nil} functions in the list one by one, without any argument. Each function
unless it can and wants to take responsibility for the completion data for the should return @code{nil} unless it can and wants to take
text at point. Otherwise it should return a list of the form responsibility for the completion data for the text at point.
Otherwise it should return a list of the following form:
@example @example
(@var{start} @var{end} @var{collection} . @var{props}) (@var{start} @var{end} @var{collection} . @var{props})
@ -1910,8 +1911,8 @@ next function in @code{completion-at-point-functions} instead of
reporting a completion failure. reporting a completion failure.
@end table @end table
The functions on this hook should generally return quickly, since they may be The functions on this hook should generally return quickly, since they
called very often (e.g., from @code{post-command-hook}). may be called very often (e.g., from @code{post-command-hook}).
Supplying a function for @var{collection} is strongly recommended if Supplying a function for @var{collection} is strongly recommended if
generating the list of completions is an expensive operation. Emacs generating the list of completions is an expensive operation. Emacs
may internally call functions in @code{completion-at-point-functions} may internally call functions in @code{completion-at-point-functions}
@ -1934,10 +1935,11 @@ can defer generating completions until necessary. You can use
(my-make-completions))))) (my-make-completions)))))
@end smallexample @end smallexample
Additionally, the @var{collection} should generally not be pre-filtered based Additionally, the @var{collection} should generally not be
on the current text between @var{start} and @var{end}, because that is the pre-filtered based on the current text between @var{start} and
responsibility of the caller of @code{completion-at-point-functions} to do that @var{end}, because that is the responsibility of the caller of
according to the completion styles it decides to use. @code{completion-at-point-functions} to do that according to the
completion styles it decides to use.
A function in @code{completion-at-point-functions} may also return a A function in @code{completion-at-point-functions} may also return a
function instead of a list as described above. In that case, that function instead of a list as described above. In that case, that

View file

@ -2078,10 +2078,11 @@ Currently supported properties are all the properties that can appear in
As is the case with most hooks, the functions are responsible for As is the case with most hooks, the functions are responsible for
preserving things like point and current buffer. preserving things like point and current buffer.
NOTE: These functions should be cheap to run since they're sometimes run from NOTE: These functions should be cheap to run since they're sometimes
`post-command-hook' and they should ideally only choose which kind of run from `post-command-hook'; and they should ideally only choose
completion table to use and not pre-filter it based on the current text between which kind of completion table to use, and not pre-filter it based
START and END (e.g. that would not obey `completion-styles').") on the current text between START and END (e.g., they should not
obey `completion-styles').")
(defvar completion--capf-misbehave-funs nil (defvar completion--capf-misbehave-funs nil
"List of functions found on `completion-at-point-functions' that misbehave. "List of functions found on `completion-at-point-functions' that misbehave.