comparison lisp/ilisp/completer.new.el @ 30:ec9a17fef872 r19-15b98

Import from CVS: tag r19-15b98
author cvs
date Mon, 13 Aug 2007 08:52:29 +0200
parents b82b59fe008d
children 131b0175ea99
comparison
equal deleted inserted replaced
29:7976500f47f9 30:ec9a17fef872
257 ;;; 257 ;;;
258 (defun completer-choice (string choices delimiters use-words) 258 (defun completer-choice (string choices delimiters use-words)
259 "Return the best match of STRING in CHOICES with DELIMITERS between 259 "Return the best match of STRING in CHOICES with DELIMITERS between
260 words and T if it is unique. A match is unique if it is the only 260 words and T if it is unique. A match is unique if it is the only
261 possibility or when USE-WORDS the only possibility with the same 261 possibility or when USE-WORDS the only possibility with the same
262 number of words. The shortest string of multiple possiblities will be 262 number of words. The shortest string of multiple possibilities will be
263 the best match." 263 the best match."
264 (or (if (null (cdr choices)) (cons (car choices) t)) 264 (or (if (null (cdr choices)) (cons (car choices) t))
265 (let* ((regexp (concat "[^" delimiters "]*[" delimiters "]")) 265 (let* ((regexp (concat "[^" delimiters "]*[" delimiters "]"))
266 (words (if use-words (completer-words regexp string))) 266 (words (if use-words (completer-words regexp string)))
267 (choice choices) 267 (choice choices)