diff options
| -rw-r--r-- | doc/lispref/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/lispref/minibuf.texi | 7 | ||||
| -rw-r--r-- | etc/NEWS | 6 | ||||
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/minibuffer.el | 14 |
5 files changed, 28 insertions, 7 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 6a105a03b3b..6eb45dc3f4f 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-02-27 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * minibuf.texi (Programmed Completion): | ||
| 4 | Mention completion-table-with-cache. | ||
| 5 | |||
| 1 | 2014-02-25 Glenn Morris <rgm@gnu.org> | 6 | 2014-02-25 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * display.texi (Window Systems): | 8 | * display.texi (Window Systems): |
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index d618912de8a..fded0dfdd92 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi | |||
| @@ -1814,6 +1814,13 @@ possible completions of it. You can think of | |||
| 1814 | and the interface for programmed completion functions. | 1814 | and the interface for programmed completion functions. |
| 1815 | @end defun | 1815 | @end defun |
| 1816 | 1816 | ||
| 1817 | @defun completion-table-with-cache function &optional ignore-case | ||
| 1818 | This is a wrapper for @code{completion-table-dynamic} that saves the | ||
| 1819 | last argument-result pair. This means that multiple lookups with the | ||
| 1820 | same argument only need to call @var{function} once. This can be useful | ||
| 1821 | when a slow operation is involved, such as calling an external process. | ||
| 1822 | @end defun | ||
| 1823 | |||
| 1817 | @node Completion in Buffers | 1824 | @node Completion in Buffers |
| 1818 | @subsection Completion in Ordinary Buffers | 1825 | @subsection Completion in Ordinary Buffers |
| 1819 | @cindex inline completion | 1826 | @cindex inline completion |
| @@ -1183,15 +1183,17 @@ Either use `completion-all-completions', which returns highlighted | |||
| 1183 | strings (including for partial or substring completion), or call | 1183 | strings (including for partial or substring completion), or call |
| 1184 | `completion-hilit-commonality' to add the highlight. | 1184 | `completion-hilit-commonality' to add the highlight. |
| 1185 | 1185 | ||
| 1186 | +++ | ||
| 1186 | *** New function `completion-table-with-cache' is a wrapper for | 1187 | *** New function `completion-table-with-cache' is a wrapper for |
| 1187 | `completion-table-dynamic' that caches the result of the last lookup. | 1188 | `completion-table-dynamic' that caches the result of the last lookup. |
| 1188 | 1189 | ||
| 1190 | +++ | ||
| 1189 | *** New function `completion-table-merge' to combine several | 1191 | *** New function `completion-table-merge' to combine several |
| 1190 | completion tables by merging their completions. | 1192 | completion tables by merging their completions. |
| 1191 | 1193 | ||
| 1192 | ** New minor modes `prettify-symbols-mode' and `global-prettify-symbols-mode' | 1194 | ** New minor modes `prettify-symbols-mode' and `global-prettify-symbols-mode' |
| 1193 | let you enable symbol prettification (replacing a string like "lambda" with | 1195 | display specified symbols as composed characters. E.g., in Emacs Lisp mode, |
| 1194 | the Greek lambda character). | 1196 | this replaces the string "lambda" with the Greek lambda character. |
| 1195 | 1197 | ||
| 1196 | ** Terminal changes | 1198 | ** Terminal changes |
| 1197 | 1199 | ||
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0198c0f8dc5..66514f7488c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2014-02-27 Glenn Morris <rgm@gnu.org> | 1 | 2014-02-27 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * minibuffer.el (completion-table-dynamic) | ||
| 4 | (completion-table-with-cache): Doc fixes. | ||
| 5 | |||
| 3 | * emacs-lisp/crm.el (crm-default-separator, crm-separator) | 6 | * emacs-lisp/crm.el (crm-default-separator, crm-separator) |
| 4 | (completing-read-multiple): Doc fixes. | 7 | (completing-read-multiple): Doc fixes. |
| 5 | 8 | ||
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) |