aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2018-04-01 12:19:49 +0300
committerEli Zaretskii2018-04-01 12:22:39 +0300
commit9fee1b8fb3395bde2d2e28e46c6690c36f730780 (patch)
tree7c21b0d2845e9c2785e7ea1e613b11353d9b6301
parent748f0fdd5a682d3bea79e3d30782686eae6d24df (diff)
downloademacs-9fee1b8fb3395bde2d2e28e46c6690c36f730780.tar.gz
emacs-9fee1b8fb3395bde2d2e28e46c6690c36f730780.zip
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 a8ddd05d7d32946b892b9faaba6c9736ed2ad847)
-rw-r--r--doc/lispref/minibuf.texi22
-rw-r--r--lisp/minibuffer.el9
2 files changed, 17 insertions, 14 deletions
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi
index b01ebb26b69..1d1c93dd144 100644
--- a/doc/lispref/minibuf.texi
+++ b/doc/lispref/minibuf.texi
@@ -1877,10 +1877,11 @@ are used to compute a completion table for completing the text at
1877point. It can be used by major modes to provide mode-specific 1877point. It can be used by major modes to provide mode-specific
1878completion tables (@pxref{Major Mode Conventions}). 1878completion tables (@pxref{Major Mode Conventions}).
1879 1879
1880When the command @code{completion-at-point} runs, it calls the functions in the 1880When the command @code{completion-at-point} runs, it calls the
1881list one by one, without any argument. Each function should return @code{nil} 1881functions in the list one by one, without any argument. Each function
1882unless it can and wants to take responsibility for the completion data for the 1882should return @code{nil} unless it can and wants to take
1883text at point. Otherwise it should return a list of the form 1883responsibility for the completion data for the text at point.
1884Otherwise it should return a list of the following form:
1884 1885
1885@example 1886@example
1886(@var{start} @var{end} @var{collection} . @var{props}) 1887(@var{start} @var{end} @var{collection} . @var{props})
@@ -1910,8 +1911,8 @@ next function in @code{completion-at-point-functions} instead of
1910reporting a completion failure. 1911reporting a completion failure.
1911@end table 1912@end table
1912 1913
1913The functions on this hook should generally return quickly, since they may be 1914The functions on this hook should generally return quickly, since they
1914called very often (e.g., from @code{post-command-hook}). 1915may be called very often (e.g., from @code{post-command-hook}).
1915Supplying a function for @var{collection} is strongly recommended if 1916Supplying a function for @var{collection} is strongly recommended if
1916generating the list of completions is an expensive operation. Emacs 1917generating the list of completions is an expensive operation. Emacs
1917may internally call functions in @code{completion-at-point-functions} 1918may internally call functions in @code{completion-at-point-functions}
@@ -1934,10 +1935,11 @@ can defer generating completions until necessary. You can use
1934 (my-make-completions))))) 1935 (my-make-completions)))))
1935@end smallexample 1936@end smallexample
1936 1937
1937Additionally, the @var{collection} should generally not be pre-filtered based 1938Additionally, the @var{collection} should generally not be
1938on the current text between @var{start} and @var{end}, because that is the 1939pre-filtered based on the current text between @var{start} and
1939responsibility of the caller of @code{completion-at-point-functions} to do that 1940@var{end}, because that is the responsibility of the caller of
1940according to the completion styles it decides to use. 1941@code{completion-at-point-functions} to do that according to the
1942completion styles it decides to use.
1941 1943
1942A function in @code{completion-at-point-functions} may also return a 1944A function in @code{completion-at-point-functions} may also return a
1943function instead of a list as described above. In that case, that 1945function instead of a list as described above. In that case, that
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index ced0ce64b50..7e7856f3a96 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -2078,10 +2078,11 @@ Currently supported properties are all the properties that can appear in
2078As is the case with most hooks, the functions are responsible for 2078As is the case with most hooks, the functions are responsible for
2079preserving things like point and current buffer. 2079preserving things like point and current buffer.
2080 2080
2081NOTE: These functions should be cheap to run since they're sometimes run from 2081NOTE: These functions should be cheap to run since they're sometimes
2082`post-command-hook' and they should ideally only choose which kind of 2082run from `post-command-hook'; and they should ideally only choose
2083completion table to use and not pre-filter it based on the current text between 2083which kind of completion table to use, and not pre-filter it based
2084START and END (e.g. that would not obey `completion-styles').") 2084on the current text between START and END (e.g., they should not
2085obey `completion-styles').")
2085 2086
2086(defvar completion--capf-misbehave-funs nil 2087(defvar completion--capf-misbehave-funs nil
2087 "List of functions found on `completion-at-point-functions' that misbehave. 2088 "List of functions found on `completion-at-point-functions' that misbehave.