• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/emacs-lisp/

Lines Matching defs:completion

1 ;;; crm.el --- read multiple strings with completion
7 ;; Keywords: completion, minibuffer, multiple elements
30 ;; with completion.
33 ;; a single prompt, optionally using completion.
54 ;; to provide completion in certain circumstances. One of the reasons
57 ;; separator-invoked completion should be provided.
80 ;; -TODO: possibly make return values from `crm-do-completion' into constants
100 completion candidates. Modify this value to make `completing-read-multiple'
104 (defvar crm-local-completion-map nil
105 "Local keymap for minibuffer multiple input with completion.
106 Analog of `minibuffer-local-completion-map'.")
109 "Local keymap for minibuffer multiple input with exact match completion.
112 (defvar crm-completion-table nil
114 This is a table used for completion by `completing-read-multiple' and its
118 (defvar crm-last-exact-completion nil
149 "Function used by `completing-read-multiple' to compute completion values.
155 The value of FLAG is used to specify the type of completion operation.
156 A value of nil specifies `try-completion'. A value of t specifies
168 (let ((result (try-completion string crm-completion-table predicate)))
175 ;; called via (all-completions string 'crm-completion-fn predicate)?
176 (all-completions string crm-completion-table predicate)
177 ;; called via (try-completion string 'crm-completion-fn predicate)?
178 (let ((result (try-completion string crm-completion-table predicate)))
227 (defun crm-test-completion (candidate)
228 "Return t if CANDIDATE is an exact match for a valid completion."
232 candidate crm-completion-table minibuffer-completion-predicate)))
237 (defun crm-minibuffer-completion-help ()
240 (message "Making completion list...")
244 minibuffer-completion-table
245 minibuffer-completion-predicate)))
250 (display-completion-list
255 (defun crm-do-completion ()
256 "This is the internal completion engine.
261 0 - the string has no possible completion
266 5 - some completion has been done, but the result is not a match
267 6 - no completion was done, and the string is not an exact match"
271 (let (last completion completedp)
272 (setq completion
273 (try-completion crm-current-element
274 minibuffer-completion-table
275 minibuffer-completion-predicate))
276 (setq last crm-last-exact-completion)
277 (setq crm-last-exact-completion nil)
281 (if (null completion) ; no possible completion
286 (if (eq completion t) ; was already an exact and unique completion
290 (null (string-equal completion crm-current-element)))
295 (insert crm-left-of-element completion)
301 (setq crm-current-element completion)))
303 (if (null (crm-test-completion crm-current-element))
305 (if completedp ; some completion happened
307 (if completion-auto-help
308 (crm-minibuffer-completion-help)
314 (setq crm-last-exact-completion completion)
318 (crm-minibuffer-completion-help))))
320 ;; returning -- was already an exact completion
350 (result (crm-do-completion)))
358 (crm-temp-echo-area-glyphs " [Sole completion]")
374 The table and predicate used for completion are
375 `minibuffer-completion-table' and `minibuffer-completion-predicate',
396 (setq result (try-completion (substring string 0 index)
397 minibuffer-completion-table
398 minibuffer-completion-predicate))
422 position in SEPARATED-STRING up to where completion was successful."
431 result (try-completion current-string
432 minibuffer-completion-table
433 minibuffer-completion-predicate))
445 minibuffer-completion-table
446 minibuffer-completion-predicate)))
491 (if (not (null (crm-test-completion crm-current-element)))
495 (let ((result (crm-do-completion)))
502 (if (not (null minibuffer-completion-confirm))
532 If REQUIRE-MATCH is nil, the keymap `crm-local-completion-map' is used.
533 This keymap inherits from the keymap named `minibuffer-local-completion-map'.
541 (unless crm-local-completion-map
542 (setq crm-local-completion-map (make-sparse-keymap))
543 (set-keymap-parent crm-local-completion-map
544 minibuffer-local-completion-map)
546 (define-key crm-local-completion-map
569 "Read multiple strings in the minibuffer, with completion.
571 single prompt, optionally using completion.
595 (let* ((minibuffer-completion-table (function crm-collection-fn))
596 (minibuffer-completion-predicate predicate)
598 (minibuffer-completion-confirm
600 (crm-completion-table table)
601 crm-last-exact-completion
609 crm-local-completion-map))