emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: try-completion not showing all possible completions?


From: Chris Mears
Subject: Re: try-completion not showing all possible completions?
Date: Thu, 05 Jan 2006 17:01:16 +1100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>>     (let ((table (make-vector 1021 0)))
>>       (intern "johnny jones" table)
>>       (intern "joe blow" table)
>>       (intern "jimi hendrix" table)
>>       (try-completion "j" table (lambda (s) (princ (format "%s\n" s)))))
>
>> I would expect the output to be all three names in the table.  However,
>> in the current CVS Emacs it produces:
>
>>     johnny jones
>>     jimi hendrix
>>     "j"
[...]
> Simple optimization: after seeing johnny jones and jimi hendrix,
> try-completion already knows that the return value will be "j", so it
> doesn't look any further.

Thank you, that makes perfect sense.  The documentation for
try-completion is a little misleading; it says:

"Each car of each element of ALIST (or each element if it is not a cons
cell) is tested to see if it begins with STRING."

I understood this to mean that the predicate (try-completion's third
argument) would be run on *each and every* element of ALIST.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]