aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2019-08-14 22:43:24 -0700
committerLars Ingebrigtsen2019-08-14 22:43:24 -0700
commite67503dc48ace83df0a521c40f4395dae96f0d53 (patch)
treea72ec8b64f33acdc0708776c8e1f3bdddef4008f
parent3580950a3fabe66cd7ece8dbe179e69c86aeceea (diff)
downloademacs-e67503dc48ace83df0a521c40f4395dae96f0d53.tar.gz
emacs-e67503dc48ace83df0a521c40f4395dae96f0d53.zip
Clarify the doc string of complete-with-action
* lisp/minibuffer.el (complete-with-action): Doc string clarification (bug#13993).
-rw-r--r--lisp/minibuffer.el22
1 files changed, 14 insertions, 8 deletions
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 52455ccc40c..3fa637f2acd 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -154,14 +154,20 @@ Like CL's `some'."
154 (or res 154 (or res
155 (if firsterror (signal (car firsterror) (cdr firsterror)))))) 155 (if firsterror (signal (car firsterror) (cdr firsterror))))))
156 156
157(defun complete-with-action (action table string pred) 157(defun complete-with-action (action collection string predicate)
158 "Perform completion ACTION. 158 "Perform completion according to ACTION.
159STRING is the string to complete. 159STRING, COLLECTION and PREDICATE are used as in `try-completion'.
160TABLE is the completion table. 160
161PRED is a completion predicate. 161If COLLECTION is a function, it will be called directly to
162ACTION can be one of nil, t or `lambda'." 162perform completion, no matter what ACTION is.
163
164If ACTION is `metadata' or a list where the first element is
165`boundaries', return nil. If ACTION is nil, this function works
166like `try-completion'; if it's t, this function works like
167`all-completion'; and any other values makes it work like
168`test-completion'."
163 (cond 169 (cond
164 ((functionp table) (funcall table string pred action)) 170 ((functionp collection) (funcall collection string predicate action))
165 ((eq (car-safe action) 'boundaries) nil) 171 ((eq (car-safe action) 'boundaries) nil)
166 ((eq action 'metadata) nil) 172 ((eq action 'metadata) nil)
167 (t 173 (t
@@ -170,7 +176,7 @@ ACTION can be one of nil, t or `lambda'."
170 ((null action) 'try-completion) 176 ((null action) 'try-completion)
171 ((eq action t) 'all-completions) 177 ((eq action t) 'all-completions)
172 (t 'test-completion)) 178 (t 'test-completion))
173 string table pred)))) 179 string collection predicate))))
174 180
175(defun completion-table-dynamic (fun &optional switch-buffer) 181(defun completion-table-dynamic (fun &optional switch-buffer)
176 "Use function FUN as a dynamic completion table. 182 "Use function FUN as a dynamic completion table.