diff options
| author | Eli Zaretskii | 2019-02-23 15:31:15 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2019-02-23 15:31:15 +0200 |
| commit | dee3cdc50415a3fa45c6b043590d99adf47c7c69 (patch) | |
| tree | 2b60f4ea1430242451239ff3e800f601ddb80ea0 | |
| parent | c86d41911dad6b3ef799d5cda5778768b2aa3aec (diff) | |
| download | emacs-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.texi | 39 |
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 | |||
| 1102 | in the minibuffer to do completion. | 1102 | in the minibuffer to do completion. |
| 1103 | 1103 | ||
| 1104 | @defvar minibuffer-completion-table | 1104 | @defvar minibuffer-completion-table |
| 1105 | The value of this variable is the completion table used for completion | 1105 | The value of this variable is the completion table (@pxref{Basic |
| 1106 | in the minibuffer. This is the global variable that contains what | 1106 | Completion}) used for completion in the minibuffer. This is the |
| 1107 | @code{completing-read} passes to @code{try-completion}. It is used by | 1107 | global variable that contains what @code{completing-read} passes to |
| 1108 | minibuffer completion commands such as | 1108 | @code{try-completion}. It is used by minibuffer completion commands |
| 1109 | @code{minibuffer-complete-word}. | 1109 | such 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 |
| 1767 | A flag specifying the type of completion operation to perform. This | 1767 | A flag specifying the type of completion operation to perform; see |
| 1768 | @ref{Basic Completion}, for the details of those operations. This | ||
| 1768 | flag may be one of the following values. | 1769 | flag 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 |
| 1837 | This function is a convenient way to write a function that can act as | 1838 | This function is a convenient way to write a function that can act as |
| 1838 | a programmed completion function. The argument @var{function} should be | 1839 | a programmed completion function. The argument @var{function} should |
| 1839 | a function that takes one argument, a string, and returns an alist of | 1840 | be a function that takes one argument, a string, and returns a |
| 1840 | possible completions of it. It is allowed to ignore the argument and | 1841 | completion table (@pxref{Basic Completion}) containing all the |
| 1841 | return a full list of all possible completions. You can think of | 1842 | possible completions. The table returned by @var{function} can also |
| 1842 | @code{completion-table-dynamic} as a transducer between that interface | 1843 | include elements that don't match the string argument; they are |
| 1844 | automatically filtered out by @code{completion-table-dynamic}. In | ||
| 1845 | particular, @var{function} can ignore its argument and return a full | ||
| 1846 | list of all possible completions. You can think of | ||
| 1847 | @code{completion-table-dynamic} as a transducer between @var{function} | ||
| 1843 | and the interface for programmed completion functions. | 1848 | and the interface for programmed completion functions. |
| 1844 | 1849 | ||
| 1845 | If the optional argument @var{switch-buffer} is non-@code{nil}, and | 1850 | If the optional argument @var{switch-buffer} is non-@code{nil}, and |
| 1846 | completion is performed in the minibuffer, @var{function} will be | 1851 | completion is performed in the minibuffer, @var{function} will be |
| 1847 | called with current buffer set to the buffer from which the minibuffer | 1852 | called with current buffer set to the buffer from which the minibuffer |
| 1848 | was entered. | 1853 | was entered. |
| 1854 | |||
| 1855 | The return value of @code{completion-table-dynamic} is a function that | ||
| 1856 | can be used as the 2nd argument to @code{try-completion} and | ||
| 1857 | @code{all-completions}. Note that this function will always return | ||
| 1858 | empty 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 |
| 1872 | The value of this abnormal hook should be a list of functions, which | 1882 | The value of this abnormal hook should be a list of functions, which |
| 1873 | are used to compute a completion table for completing the text at | 1883 | are used to compute a completion table (@pxref{Basic Completion}) for |
| 1874 | point. It can be used by major modes to provide mode-specific | 1884 | completing the text at point. It can be used by major modes to |
| 1875 | completion tables (@pxref{Major Mode Conventions}). | 1885 | provide mode-specific completion tables (@pxref{Major Mode |
| 1886 | Conventions}). | ||
| 1876 | 1887 | ||
| 1877 | When the command @code{completion-at-point} runs, it calls the | 1888 | When the command @code{completion-at-point} runs, it calls the |
| 1878 | functions in the list one by one, without any argument. Each function | 1889 | functions in the list one by one, without any argument. Each function |