# HG changeset patch # User Gerd Moellmann # Date 956862009 0 # Node ID efa45c683e9a583c136ffa59a853ea5f09aeddd2 # Parent 14cc47ddd47a2c3c88c6cae673b8b9b2a49885cc (crm-completion-table): New variable. (crm-collection-fn, crm-test-completion) (completing-read-multiple): Use it. diff -r 14cc47ddd47a -r efa45c683e9a lisp/emacs-lisp/crm.el --- a/lisp/emacs-lisp/crm.el Thu Apr 27 18:58:13 2000 +0000 +++ b/lisp/emacs-lisp/crm.el Thu Apr 27 19:00:09 2000 +0000 @@ -109,6 +109,11 @@ "Local keymap for minibuffer multiple input with exact match completion. Analog of `minibuffer-local-must-match-map' for crm.") +(defvar crm-completion-table nil + "An alist whose elements' cars are strings, or an obarray. +This is a table used for completion by `completing-read-multiple' and its +supporting functions.") + ;; this is supposed to be analogous to last_exact_completion in src/minibuf.c (defvar crm-last-exact-completion nil "Completion string if last attempt reported \"Complete, but not unique\".") @@ -160,7 +165,7 @@ (setq string (substring string (match-end 0)))) (if (eq flag 'lambda) ;; return t for exact match, nil otherwise - (let ((result (try-completion string table predicate))) + (let ((result (try-completion string crm-completion-table predicate))) (if (stringp result) nil (if result @@ -168,9 +173,9 @@ nil)))) (if flag ;; called via (all-completions string 'crm-completion-fn predicate)? - (all-completions string table predicate) + (all-completions string crm-completion-table predicate) ;; called via (try-completion string 'crm-completion-fn predicate)? - (let ((result (try-completion string table predicate))) + (let ((result (try-completion string crm-completion-table predicate))) (if (stringp result) (concat lead result) result))))) @@ -221,7 +226,8 @@ "Return t if CANDIDATE is an exact match for a valid completion." (let ((completions ;; TODO: verify whether the arguments are appropriate - (all-completions candidate table minibuffer-completion-predicate))) + (all-completions + candidate crm-completion-table minibuffer-completion-predicate))) (if (member candidate completions) t nil))) @@ -587,6 +593,7 @@ (minibuffer-completion-confirm (if (eq require-match t) nil t)) + (crm-completion-table table) crm-last-exact-completion crm-current-element crm-left-of-element