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

Re: Some problem with completion matching

Bart Schaefer wrote:

> On Dec 13,  6:52pm, Andrej Borsenkow wrote:
> } 
> } bor@itsrm2% l ntpd/*.c
> } ntpd/check_y2k.c            ntpd/map_vme.c
> } ntpd/ntp_config.c           ntpd/ntp_control.c
> } ntpd/ntp_crypto.c           ntpd/ntp_filegen.c
> } ..... etc
> } bor@itsrm2% l ntpd/.cTAB
> } bor@itsrm2% l ntpd/ntpd.c
> } Completing file
> } ntpd.c      version.c
> } 
> } ???
> } 
> } bor@itsrm2% zstyle -L
> } zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-z}={A-Z}
> } r:|[._-]=* r:|=*' 'm:{a-z}={A-Z} r:|[.-]=** r:|=**'
>   ^^^^^^^^^^
> I *think* the behavior you're seeing is correct, but Sven will have to
> confirm.  The match spec I marked means that file names are to split into
> segments at dot, underscore, and hyphen, for purposes of matching.  The
> doc says that "... the anchor can occur anywhere, but must match in both
> the command line and trial completion strings."  Since there's only one
> match for the anchor on the command line, only files having a single
> such segment are eligible for completion.

That's right. And it's the reason why I added -- on Andrej's request -- 
the `**'-thing. So, if you (Andrej) remove your third (including the '')
matcher so that the 'm:{a-z}={A-Z} r:|[._-]=** r:|=**' is the third
one, it'll work.

What's irritating you is probably that you seem to get different
behaviours depending on the directory contents. That's of course
because you used `**' in the last matcher. If there is at least one
file with only one of the anchor characters, the third one matches and 
you don't see any of the other matches. If all files have at least two 
anchor characters, you see all of them because the third matcher
doesn't help but the last matcher makes them be matched.


Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx

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