aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2000-04-27 19:00:09 +0000
committerGerd Moellmann2000-04-27 19:00:09 +0000
commitec266158e44f0acf4f5139244de8aecf00bbb56b (patch)
tree7f56afe6000d0f8b2f511cc37fb01db3597d96cb
parent11595aa959b567dfe9b06e24d43c6cd061e0a0eb (diff)
downloademacs-ec266158e44f0acf4f5139244de8aecf00bbb56b.tar.gz
emacs-ec266158e44f0acf4f5139244de8aecf00bbb56b.zip
(crm-completion-table): New variable.
(crm-collection-fn, crm-test-completion) (completing-read-multiple): Use it.
-rw-r--r--lisp/emacs-lisp/crm.el15
1 files changed, 11 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/crm.el b/lisp/emacs-lisp/crm.el
index 55c52b082a9..dda03743080 100644
--- a/lisp/emacs-lisp/crm.el
+++ b/lisp/emacs-lisp/crm.el
@@ -109,6 +109,11 @@ Analog of `minibuffer-local-completion-map'.")
109 "Local keymap for minibuffer multiple input with exact match completion. 109 "Local keymap for minibuffer multiple input with exact match completion.
110Analog of `minibuffer-local-must-match-map' for crm.") 110Analog of `minibuffer-local-must-match-map' for crm.")
111 111
112(defvar crm-completion-table nil
113 "An alist whose elements' cars are strings, or an obarray.
114This is a table used for completion by `completing-read-multiple' and its
115supporting functions.")
116
112;; this is supposed to be analogous to last_exact_completion in src/minibuf.c 117;; this is supposed to be analogous to last_exact_completion in src/minibuf.c
113(defvar crm-last-exact-completion nil 118(defvar crm-last-exact-completion nil
114 "Completion string if last attempt reported \"Complete, but not unique\".") 119 "Completion string if last attempt reported \"Complete, but not unique\".")
@@ -160,7 +165,7 @@ Functions'."
160 (setq string (substring string (match-end 0)))) 165 (setq string (substring string (match-end 0))))
161 (if (eq flag 'lambda) 166 (if (eq flag 'lambda)
162 ;; return t for exact match, nil otherwise 167 ;; return t for exact match, nil otherwise
163 (let ((result (try-completion string table predicate))) 168 (let ((result (try-completion string crm-completion-table predicate)))
164 (if (stringp result) 169 (if (stringp result)
165 nil 170 nil
166 (if result 171 (if result
@@ -168,9 +173,9 @@ Functions'."
168 nil)))) 173 nil))))
169 (if flag 174 (if flag
170 ;; called via (all-completions string 'crm-completion-fn predicate)? 175 ;; called via (all-completions string 'crm-completion-fn predicate)?
171 (all-completions string table predicate) 176 (all-completions string crm-completion-table predicate)
172 ;; called via (try-completion string 'crm-completion-fn predicate)? 177 ;; called via (try-completion string 'crm-completion-fn predicate)?
173 (let ((result (try-completion string table predicate))) 178 (let ((result (try-completion string crm-completion-table predicate)))
174 (if (stringp result) 179 (if (stringp result)
175 (concat lead result) 180 (concat lead result)
176 result))))) 181 result)))))
@@ -221,7 +226,8 @@ and return t."
221 "Return t if CANDIDATE is an exact match for a valid completion." 226 "Return t if CANDIDATE is an exact match for a valid completion."
222 (let ((completions 227 (let ((completions
223 ;; TODO: verify whether the arguments are appropriate 228 ;; TODO: verify whether the arguments are appropriate
224 (all-completions candidate table minibuffer-completion-predicate))) 229 (all-completions
230 candidate crm-completion-table minibuffer-completion-predicate)))
225 (if (member candidate completions) 231 (if (member candidate completions)
226 t 232 t
227 nil))) 233 nil)))
@@ -587,6 +593,7 @@ INHERIT-INPUT-METHOD."
587 (minibuffer-completion-confirm (if (eq require-match t) 593 (minibuffer-completion-confirm (if (eq require-match t)
588 nil 594 nil
589 t)) 595 t))
596 (crm-completion-table table)
590 crm-last-exact-completion 597 crm-last-exact-completion
591 crm-current-element 598 crm-current-element
592 crm-left-of-element 599 crm-left-of-element