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

Re: Some problem with completion matching

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.

I have a similar problem with my own matcher-list which I've been sort of
halfheartedly trying to work out for a while now.  This example has made
me understand it better, but I still don't see a solution.

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