[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-25 bba8c53: Update documentation of 'completion-tabl
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] emacs-25 bba8c53: Update documentation of 'completion-table-dynamic' |
Date: |
Tue, 12 Jan 2016 19:11:37 +0000 |
branch: emacs-25
commit bba8c532fa025a3efffdcccd40bfe66a4e9effd2
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>
Update documentation of 'completion-table-dynamic'
* doc/lispref/minibuf.texi (Programmed Completion): Document the
new optional argument to 'completion-table-dynamic'.
---
doc/lispref/minibuf.texi | 10 ++++++++--
etc/NEWS | 8 +++++---
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi
index ead4fe9..e24d2cd 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
the same as for @code{display-sort-function}.
@end table
address@hidden completion-table-dynamic function
address@hidden completion-table-dynamic function &optional switch-buffer
This function is a convenient way to write a function that can act as
a programmed completion function. The argument @var{function} should be
a function that takes one argument, a string, and returns an alist of
-possible completions of it. You can think of
+possible completions of it. It is allowed to ignore the argument and
+return a full list of all possible completions. You can think of
@code{completion-table-dynamic} as a transducer between that interface
and the interface for programmed completion functions.
+
+If the optional argument @var{switch-buffer} is address@hidden, and
+completion is performed in the minibuffer, @var{function} will be
+called with current buffer set to the buffer from which the minibuffer
+was entered.
@end defun
@defun completion-table-with-cache function &optional ignore-case
diff --git a/etc/NEWS b/etc/NEWS
index 029e9d8..34c489a 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1225,10 +1225,12 @@ Use `save-mark-and-excursion' if you want the old
behavior.
** `read-buffer' and `read-buffer-function' can now be called with a 4th
argument (`predicate').
-** completion-table-dynamic stays in the minibuffer.
++++
+** `completion-table-dynamic' by default stays in the minibuffer.
+The minibuffer will be the current buffer when the function is called.
If you want the old behavior of calling the function in the buffer
-from which the minibuffer was entered, call it with the new argument
-`switch-buffer'.
+from which the minibuffer was entered, use the new argument
+`switch-buffer' to `completion-table-dynamic'.
** window-configurations no longer record the buffers' marks.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-25 bba8c53: Update documentation of 'completion-table-dynamic',
Eli Zaretskii <=