diff options
| -rw-r--r-- | doc/lispref/minibuf.texi | 10 | ||||
| -rw-r--r-- | etc/NEWS | 8 |
2 files changed, 13 insertions, 5 deletions
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index ead4fe982dc..e24d2cd643a 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi | |||
| @@ -1818,13 +1818,19 @@ emacs, The GNU Emacs Manual}. Its argument list and return value are | |||
| 1818 | the same as for @code{display-sort-function}. | 1818 | the same as for @code{display-sort-function}. |
| 1819 | @end table | 1819 | @end table |
| 1820 | 1820 | ||
| 1821 | @defun completion-table-dynamic function | 1821 | @defun completion-table-dynamic function &optional switch-buffer |
| 1822 | This function is a convenient way to write a function that can act as | 1822 | This function is a convenient way to write a function that can act as |
| 1823 | a programmed completion function. The argument @var{function} should be | 1823 | a programmed completion function. The argument @var{function} should be |
| 1824 | a function that takes one argument, a string, and returns an alist of | 1824 | a function that takes one argument, a string, and returns an alist of |
| 1825 | possible completions of it. You can think of | 1825 | possible completions of it. It is allowed to ignore the argument and |
| 1826 | return a full list of all possible completions. You can think of | ||
| 1826 | @code{completion-table-dynamic} as a transducer between that interface | 1827 | @code{completion-table-dynamic} as a transducer between that interface |
| 1827 | and the interface for programmed completion functions. | 1828 | and the interface for programmed completion functions. |
| 1829 | |||
| 1830 | If the optional argument @var{switch-buffer} is non-@code{nil}, and | ||
| 1831 | completion is performed in the minibuffer, @var{function} will be | ||
| 1832 | called with current buffer set to the buffer from which the minibuffer | ||
| 1833 | was entered. | ||
| 1828 | @end defun | 1834 | @end defun |
| 1829 | 1835 | ||
| 1830 | @defun completion-table-with-cache function &optional ignore-case | 1836 | @defun completion-table-with-cache function &optional ignore-case |
| @@ -1225,10 +1225,12 @@ Use `save-mark-and-excursion' if you want the old behavior. | |||
| 1225 | ** `read-buffer' and `read-buffer-function' can now be called with a 4th | 1225 | ** `read-buffer' and `read-buffer-function' can now be called with a 4th |
| 1226 | argument (`predicate'). | 1226 | argument (`predicate'). |
| 1227 | 1227 | ||
| 1228 | ** completion-table-dynamic stays in the minibuffer. | 1228 | +++ |
| 1229 | ** `completion-table-dynamic' by default stays in the minibuffer. | ||
| 1230 | The minibuffer will be the current buffer when the function is called. | ||
| 1229 | If you want the old behavior of calling the function in the buffer | 1231 | If you want the old behavior of calling the function in the buffer |
| 1230 | from which the minibuffer was entered, call it with the new argument | 1232 | from which the minibuffer was entered, use the new argument |
| 1231 | `switch-buffer'. | 1233 | `switch-buffer' to `completion-table-dynamic'. |
| 1232 | 1234 | ||
| 1233 | ** window-configurations no longer record the buffers' marks. | 1235 | ** window-configurations no longer record the buffers' marks. |
| 1234 | 1236 | ||