comparison lisp/ilisp/completer.new.el @ 108:360340f9fd5f r20-1b6

Import from CVS: tag r20-1b6
author cvs
date Mon, 13 Aug 2007 09:18:39 +0200
parents 131b0175ea99
children
comparison
equal deleted inserted replaced
107:523141596bda 108:360340f9fd5f
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)