;;; crm.el --- read multiple strings with completion
-;; Copyright (C) 1985, 1986, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 1985-1986, 1993-2012 Free Software Foundation, Inc.
;; Author: Sen Nagata <sen@eccosys.com>
;; Keywords: completion, minibuffer, multiple elements
The value of FLAG is used to specify the type of completion operation.
A value of nil specifies `try-completion'. A value of t specifies
-`all-completions'. A value of lambda specifes a test for an exact match.
+`all-completions'. A value of lambda specifies a test for an exact match.
For more information on STRING, PREDICATE, and FLAG, see the Elisp
Reference sections on 'Programmed Completion' and 'Basic Completion
(forward-char 1))
(if doexit (exit-minibuffer))))
-(defun crm--choose-completion-string (choice buffer mini-p base-size)
+(defun crm--choose-completion-string (choice buffer base-position
+ &rest ignored)
"Completion string chooser for `completing-read-multiple'.
This is called from `choose-completion-string-functions'.
It replaces the string that is currently being completed, without
exiting the minibuffer."
- (let ((ol (crm--select-current-element)))
- (if base-size
- (delete-region (+ base-size (field-beginning)) (point))
- (choose-completion-delete-max-match choice))
- (insert choice)
- (remove-text-properties (- (point) (length choice)) (point)
- '(mouse-face nil))
- ;; Update point in the window that BUFFER is showing in.
- (let ((window (get-buffer-window buffer t)))
- (set-window-point window (point)))))
+ (let ((completion-no-auto-exit t)
+ (choose-completion-string-functions nil))
+ (choose-completion-string choice buffer base-position)
+ t))
;; superemulates behavior of completing_read in src/minibuf.c
;;;###autoload
(provide 'crm)
-;; arch-tag: db1911d9-86c6-4a42-b32a-4910701b15a6
;;; crm.el ends here