aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2019-02-23 15:31:15 +0200
committerEli Zaretskii2019-02-23 15:31:15 +0200
commitdee3cdc50415a3fa45c6b043590d99adf47c7c69 (patch)
tree2b60f4ea1430242451239ff3e800f601ddb80ea0
parentc86d41911dad6b3ef799d5cda5778768b2aa3aec (diff)
downloademacs-dee3cdc50415a3fa45c6b043590d99adf47c7c69.tar.gz
emacs-dee3cdc50415a3fa45c6b043590d99adf47c7c69.zip
Minor improvement for docs of completion
* doc/lispref/minibuf.texi (Completion Commands) (Completion in Buffers, Programmed Completion): Add to text that references completion tables a cross-reference to where "completion table" is described. (Programmed Completion): Fix the description of 'completion-table-dynamic'. Add more cross-references.
-rw-r--r--doc/lispref/minibuf.texi39
1 files changed, 25 insertions, 14 deletions
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi
index 0c0862160bf..796be07ef14 100644
--- a/doc/lispref/minibuf.texi
+++ b/doc/lispref/minibuf.texi
@@ -1102,11 +1102,11 @@ different function to completely override the normal behavior of
1102in the minibuffer to do completion. 1102in the minibuffer to do completion.
1103 1103
1104@defvar minibuffer-completion-table 1104@defvar minibuffer-completion-table
1105The value of this variable is the completion table used for completion 1105The value of this variable is the completion table (@pxref{Basic
1106in the minibuffer. This is the global variable that contains what 1106Completion}) used for completion in the minibuffer. This is the
1107@code{completing-read} passes to @code{try-completion}. It is used by 1107global variable that contains what @code{completing-read} passes to
1108minibuffer completion commands such as 1108@code{try-completion}. It is used by minibuffer completion commands
1109@code{minibuffer-complete-word}. 1109such as @code{minibuffer-complete-word}.
1110@end defvar 1110@end defvar
1111 1111
1112@defvar minibuffer-completion-predicate 1112@defvar minibuffer-completion-predicate
@@ -1764,7 +1764,8 @@ possible match, and ignore the match if the predicate returns
1764@code{nil}. 1764@code{nil}.
1765 1765
1766@item 1766@item
1767A flag specifying the type of completion operation to perform. This 1767A flag specifying the type of completion operation to perform; see
1768@ref{Basic Completion}, for the details of those operations. This
1768flag may be one of the following values. 1769flag may be one of the following values.
1769 1770
1770@table @code 1771@table @code
@@ -1835,17 +1836,26 @@ the same as for @code{display-sort-function}.
1835 1836
1836@defun completion-table-dynamic function &optional switch-buffer 1837@defun completion-table-dynamic function &optional switch-buffer
1837This function is a convenient way to write a function that can act as 1838This function is a convenient way to write a function that can act as
1838a programmed completion function. The argument @var{function} should be 1839a programmed completion function. The argument @var{function} should
1839a function that takes one argument, a string, and returns an alist of 1840be a function that takes one argument, a string, and returns a
1840possible completions of it. It is allowed to ignore the argument and 1841completion table (@pxref{Basic Completion}) containing all the
1841return a full list of all possible completions. You can think of 1842possible completions. The table returned by @var{function} can also
1842@code{completion-table-dynamic} as a transducer between that interface 1843include elements that don't match the string argument; they are
1844automatically filtered out by @code{completion-table-dynamic}. In
1845particular, @var{function} can ignore its argument and return a full
1846list of all possible completions. You can think of
1847@code{completion-table-dynamic} as a transducer between @var{function}
1843and the interface for programmed completion functions. 1848and the interface for programmed completion functions.
1844 1849
1845If the optional argument @var{switch-buffer} is non-@code{nil}, and 1850If the optional argument @var{switch-buffer} is non-@code{nil}, and
1846completion is performed in the minibuffer, @var{function} will be 1851completion is performed in the minibuffer, @var{function} will be
1847called with current buffer set to the buffer from which the minibuffer 1852called with current buffer set to the buffer from which the minibuffer
1848was entered. 1853was entered.
1854
1855The return value of @code{completion-table-dynamic} is a function that
1856can be used as the 2nd argument to @code{try-completion} and
1857@code{all-completions}. Note that this function will always return
1858empty metadata and trivial boundaries (@pxref{Programmed Completion}).
1849@end defun 1859@end defun
1850 1860
1851@defun completion-table-with-cache function &optional ignore-case 1861@defun completion-table-with-cache function &optional ignore-case
@@ -1870,9 +1880,10 @@ Emacs Manual}. This command uses the abnormal hook variable
1870 1880
1871@defvar completion-at-point-functions 1881@defvar completion-at-point-functions
1872The value of this abnormal hook should be a list of functions, which 1882The value of this abnormal hook should be a list of functions, which
1873are used to compute a completion table for completing the text at 1883are used to compute a completion table (@pxref{Basic Completion}) for
1874point. It can be used by major modes to provide mode-specific 1884completing the text at point. It can be used by major modes to
1875completion tables (@pxref{Major Mode Conventions}). 1885provide mode-specific completion tables (@pxref{Major Mode
1886Conventions}).
1876 1887
1877When the command @code{completion-at-point} runs, it calls the 1888When the command @code{completion-at-point} runs, it calls the
1878functions in the list one by one, without any argument. Each function 1889functions in the list one by one, without any argument. Each function