From 3995f0515ab0b0e359f9976d589eed45f38eaa6d Mon Sep 17 00:00:00 2001 From: Philipp Stephani Date: Fri, 23 Apr 2021 13:01:51 +0200 Subject: [PATCH] Expand documentation on nontrivial completion boundaries. The interplay between nontrivial completion boundaries and the other completion functions is somewhat subtle, so it deserves a bit more explanation. * doc/lispref/minibuf.texi (Basic Completion) (Programmed Completion): Add a few more remarks about nontrivial completion boundaries. --- doc/lispref/minibuf.texi | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index f012bfef07e..faee43b21a1 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -990,6 +990,9 @@ Also @code{all-completions} on @code{"/usr/sh"} will not include @code{completion-boundaries} will return @code{(5 . 1)} which tells us that the @var{collection} will only return completion information that pertains to the area after @code{"/usr/"} and before @code{"/doc"}. +@code{try-completion} is not affected by nontrivial boundaries; i.e., +@code{try-completion} on @code{"/usr/sh"} might still return +@code{"/usr/share/"}, not @code{"share/"}. @end defun If you store a completion alist in a variable, you should mark the @@ -1894,6 +1897,13 @@ should return @code{(boundaries @var{start} . @var{end})}, where string, and @var{end} is the position of the end boundary in @var{suffix}. +If you return nontrivial boundaries, make sure that the +@code{all-completions} operation is consistent with them. The +completions returned by @code{all-completions} should only pertain to +the piece of the prefix and suffix covered by the completion +boundaries. @ref{Basic Completion} for the precise expected semantics +of completion boundaries. + @item metadata This specifies a request for information about the state of the current completion. The return value should have the form -- 2.39.5