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

Re: Completion problems on cygwin when nocaseglob is set

On 10/24/07, Peter Stephenson <pws@xxxxxxx> wrote:
> "Vin Shelton" wrote:
> > I'm very confused.  Running zsh built from the latest CVS sources,
> > here's what I see:
> ... even with NO_CASE_GLOB set, completion doesn't match
> case-insensitively unless there's a matcher spec to do it.
> Oh dear, I hate it when people are confused about completion because
> that invariably means a hard time.

Thanks for explaining this Peter.  As a naive end-user I forget the
complexities of the inter-relationships of the parts.  Ideally (IMO),
'setopt nocaseglob' should work for both globbing and completion.

> It looks like _path_files is doing the right thing internally (via
> compfiles, which understands glob settings), but it then passes the
> matched string to compadd without the -U flag, which says "sorry mate,
> it's more than my job's worth to match case-insensitively".  _path_files
> does most of its file handling itself or via compfiles, but it doesn't
> do the special matching stuff, hence we can't pass -U in that case.
> We could make a rule that we use case-insensitive matching with
> NO_CASE_GLOB unless an explicit matcher spec is in force, I suppose, but
> we can't actually have the combined effect of nocaseglob and matchers
> without either some kind of internal rewrite, or editing the matchers
> passed down through _path_files.  If the former is acceptable, this is
> fairly straightforward.

If by 'former' you meant that NO_CASE_GLOB works if no explicit
matcher is specified (which looks like what you implemented below),
then I agree.

I applied the patch and verified that my naive test case now works.

Thank you,

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