diff options
| author | Glenn Morris | 2014-02-27 00:01:22 -0800 |
|---|---|---|
| committer | Glenn Morris | 2014-02-27 00:01:22 -0800 |
| commit | ea7826ba52b21e97c27ccf4859eaeb8dca61319b (patch) | |
| tree | c9326adac81b8bfca0411ea1cd85972c4fec3c5d /lisp/minibuffer.el | |
| parent | d926361813de2d50b42e63f1b9b603220ead6c7d (diff) | |
| download | emacs-ea7826ba52b21e97c27ccf4859eaeb8dca61319b.tar.gz emacs-ea7826ba52b21e97c27ccf4859eaeb8dca61319b.zip | |
Small doc related to new completion functions
* doc/lispref/minibuf.texi (Programmed Completion):
Mention completion-table-with-cache.
* lisp/minibuffer.el (completion-table-dynamic)
(completion-table-with-cache): Doc fixes.
* etc/NEWS: Related markup. Unrelated copyedit.
Diffstat (limited to 'lisp/minibuffer.el')
| -rw-r--r-- | lisp/minibuffer.el | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 95e45260f85..88ab94f0521 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el | |||
| @@ -179,7 +179,9 @@ FUN will be called in the buffer from which the minibuffer was entered. | |||
| 179 | 179 | ||
| 180 | The result of the `completion-table-dynamic' form is a function | 180 | The result of the `completion-table-dynamic' form is a function |
| 181 | that can be used as the COLLECTION argument to `try-completion' and | 181 | that can be used as the COLLECTION argument to `try-completion' and |
| 182 | `all-completions'. See Info node `(elisp)Programmed Completion'." | 182 | `all-completions'. See Info node `(elisp)Programmed Completion'. |
| 183 | |||
| 184 | See also the related function `completion-table-with-cache'." | ||
| 183 | (lambda (string pred action) | 185 | (lambda (string pred action) |
| 184 | (if (or (eq (car-safe action) 'boundaries) (eq action 'metadata)) | 186 | (if (or (eq (car-safe action) 'boundaries) (eq action 'metadata)) |
| 185 | ;; `fun' is not supposed to return another function but a plain old | 187 | ;; `fun' is not supposed to return another function but a plain old |
| @@ -191,13 +193,15 @@ that can be used as the COLLECTION argument to `try-completion' and | |||
| 191 | (complete-with-action action (funcall fun string) string pred))))) | 193 | (complete-with-action action (funcall fun string) string pred))))) |
| 192 | 194 | ||
| 193 | (defun completion-table-with-cache (fun &optional ignore-case) | 195 | (defun completion-table-with-cache (fun &optional ignore-case) |
| 194 | "Create dynamic completion table from FUN, with cache. | 196 | "Create dynamic completion table from function FUN, with cache. |
| 195 | This wraps `completion-table-dynamic', but saves the last | 197 | This is a wrapper for `completion-table-dynamic' that saves the last |
| 196 | argument-result pair from FUN, so that several lookups with the | 198 | argument-result pair from FUN, so that several lookups with the |
| 197 | same argument (or with an argument that starts with the first one) | 199 | same argument (or with an argument that starts with the first one) |
| 198 | only need to call FUN once. Most useful when FUN performs a relatively | 200 | only need to call FUN once. This can be useful when FUN performs a |
| 199 | slow operation, such as calling an external process (see Bug#11906). | 201 | relatively slow operation, such as calling an external process. |
| 202 | |||
| 200 | When IGNORE-CASE is non-nil, FUN is expected to be case-insensitive." | 203 | When IGNORE-CASE is non-nil, FUN is expected to be case-insensitive." |
| 204 | ;; See eg bug#11906. | ||
| 201 | (let* (last-arg last-result | 205 | (let* (last-arg last-result |
| 202 | (new-fun | 206 | (new-fun |
| 203 | (lambda (arg) | 207 | (lambda (arg) |