Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Caching between matchers

On Dec 8,  6:07pm, Borsenkow Andrej wrote:
} Subject: Caching between matchers
} When completion generates list of matche on-the-fly (like installed RPMs
} or list of available RPMs in urpmi completion) it currently does it for
} every matcher that is tried. If list is long (urpmi has ~3000 packages
} in database) or needs some time to build (esp. when forking off) it may
} take quite a bit of time.

This is why the caching mechanism (_store_cache, _retrieve_cache, and
_cache_invalid) was introduced; _urpmi should be doing its own caching.

} Because the list obviously is not changed between matchers, is it
} possible to reuse it?

This isn't precisely true.  Many completers test $_matcher_num, which is
set by main complete, and do nothing if it is greater than 1.  On the
other hand, _path_files tests whether the *last* matcher is being tried,
and may add more path expansions to the list in that case.

} Actually, is it possible to traverse matchers list internally in
} compadd?

I don't think so, because the matchers may be traversed multiple times
(e.g.  the _prefix and _ignored completers re-traverse the matcher-list).

Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   

Messages sorted by: Reverse Date, Date, Thread, Author