aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/simple.el
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>2002-06-02 00:01:59 +0000
committerRichard M. Stallman <[email protected]>2002-06-02 00:01:59 +0000
commit12829a07d6bd4f1f24b98adf852e153a103bb184 (patch)
treeba0c0d9a53ffc989022e07e140bd72b49135a896 /lisp/simple.el
parentcb8d4d07073f91dd7d2c849797e22921e0daa908 (diff)
(choose-completion-string-functions): Doc fix.
(choose-completion-string): Add doc string.
Diffstat (limited to 'lisp/simple.el')
-rw-r--r--lisp/simple.el22
1 files changed, 14 insertions, 8 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 9fc3144fb2..c5fe36e76b 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3783,19 +3783,25 @@ These functions are called in order with four arguments:
CHOICE - the string to insert in the buffer,
BUFFER - the buffer in which the choice should be inserted,
MINI-P - non-nil iff BUFFER is a minibuffer, and
-BASE-SIZE - the part of BUFFER which isn't part of completion.
+BASE-SIZE - the number of characters in BUFFER before
+the string being completed.
+
If a function in the list returns non-nil, that function is supposed
to have inserted the CHOICE in the BUFFER, and possibly exited
-the minibuffer; no further functions will be called.")
+the minibuffer; no further functions will be called.
-;; Switch to BUFFER and insert the completion choice CHOICE.
-;; BASE-SIZE, if non-nil, says how many characters of BUFFER's text
-;; to keep. If it is nil, use choose-completion-delete-max-match instead.
+If all functions in the list return nil, that means to use
+the default method of inserting the completion in BUFFER.")
-;; If BUFFER is the minibuffer, exit the minibuffer
-;; unless it is reading a file name and CHOICE is a directory,
-;; or completion-no-auto-exit is non-nil.
(defun choose-completion-string (choice &optional buffer base-size)
+ "Switch to BUFFER and insert the completion choice CHOICE.
+BASE-SIZE, if non-nil, says how many characters of BUFFER's text
+to keep. If it is nil, use choose-completion-delete-max-match instead."
+
+ ;; If BUFFER is the minibuffer, exit the minibuffer
+ ;; unless it is reading a file name and CHOICE is a directory,
+ ;; or completion-no-auto-exit is non-nil.
+
(let ((buffer (or buffer completion-reference-buffer))
(mini-p (string-match "\\` \\*Minibuf-[0-9]+\\*\\'" (buffer-name buffer))))
;; If BUFFER is a minibuffer, barf unless it's the currently