[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master e67503d: Clarify the doc string of complete-with-ac
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] master e67503d: Clarify the doc string of complete-with-action |
Date: |
Thu, 15 Aug 2019 01:43:28 -0400 (EDT) |
branch: master
commit e67503dc48ace83df0a521c40f4395dae96f0d53
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
Clarify the doc string of complete-with-action
* lisp/minibuffer.el (complete-with-action): Doc string
clarification (bug#13993).
---
lisp/minibuffer.el | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 52455cc..3fa637f 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -154,14 +154,20 @@ Like CL's `some'."
(or res
(if firsterror (signal (car firsterror) (cdr firsterror))))))
-(defun complete-with-action (action table string pred)
- "Perform completion ACTION.
-STRING is the string to complete.
-TABLE is the completion table.
-PRED is a completion predicate.
-ACTION can be one of nil, t or `lambda'."
+(defun complete-with-action (action collection string predicate)
+ "Perform completion according to ACTION.
+STRING, COLLECTION and PREDICATE are used as in `try-completion'.
+
+If COLLECTION is a function, it will be called directly to
+perform completion, no matter what ACTION is.
+
+If ACTION is `metadata' or a list where the first element is
+`boundaries', return nil. If ACTION is nil, this function works
+like `try-completion'; if it's t, this function works like
+`all-completion'; and any other values makes it work like
+`test-completion'."
(cond
- ((functionp table) (funcall table string pred action))
+ ((functionp collection) (funcall collection string predicate action))
((eq (car-safe action) 'boundaries) nil)
((eq action 'metadata) nil)
(t
@@ -170,7 +176,7 @@ ACTION can be one of nil, t or `lambda'."
((null action) 'try-completion)
((eq action t) 'all-completions)
(t 'test-completion))
- string table pred))))
+ string collection predicate))))
(defun completion-table-dynamic (fun &optional switch-buffer)
"Use function FUN as a dynamic completion table.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master e67503d: Clarify the doc string of complete-with-action,
Lars Ingebrigtsen <=