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

Re: Compadd churning on matching specs



Felix Rosencrantz wrote:

> ...
> 
> With all the matching specifications that I provided and the ones
> _path_files provided, this causes match_str to chew for a while.  This
> seems wasteful, since we already know that the first part of the path is
> fully specified.  Would it be possible to just do matching on the last
> part of the path, where "function" should be added?

No. At least, not really. The `problem' is that match_str() does more
than just check if the match matches the stuff on the line. It also
builds the mystical cline lists which contain the information we need
when building the unambiguous string.

I always wanted to see if and how I could make matching faster... maybe
now that enough people have started using match specs it is the time
to try. I'll need some time for this, though, I'm hoping to be able to 
replace some of the matching attempts with strcmp() and splitting the
string into parts. Dunno how well this will work, though.


When using match specs, it is often a good idea to give an empty
string as the first value to the matcher-list style. As Peter said, it 
reduces the number of surprising match results, but it also makes the
first attempt faster for most of the common cases.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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