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

RE: File completion under Cygwin again

> >
> > 1. drive:/path completion.
> Use the fake-files style to offer `a:/' etc. Then use an
> implementation of _first that makes compset -P '?:/' and calls _files
> with -W. Does that work?

Mmm ... yes and no. It is simply too early. It will try to modify any word
that looks like x:/foo; and it needs to be done for "real" file names only.
I.e. in _path_files.

Anyway, adding (conditional) checking for ?:/ prefix is trivial (for anybody
who spent two years on _path_files at least :-). The question is - may it be
used for something else?

Is root-name style good enough? With implied usage

zstyle 'completion:*:paths' root-name '/ ?:/'

and implementation that basically sets donepath to root-name and strips it

> > 2. UNC path completion - //server/share/path - here actually subtopics
> >  a) server name completion
> >  b) share name completion
> >  c) path completion
> I'm not exactly sure what this does, but maybe it could be done with
> some more fiddling with _first (I mean: completing the server names)?

The same as above. And could be implemented by

zstyle 'completion:*:paths' root-name '//server1/(share1|share2)/
//server2/share3/ ...'

And server/share names itself could already be completed with fake-files.

> > 4. Windows is using case-insensitive file system,
> Use the matcher style? (Not matcher-list.)
> > 5. (related to 4) things are complicated by the fact, that you can mount
> > case-sensitive file system (e.g. off SAMBA server),
> The matcher style with `zstyle -e'?

This is currently the best approximation. The only comment - this has to be
set for every tag that represents file names; users (and completion function
authors) are free to invent there own tags; and there is no ultimate tag list
currently (and cannot be).

I.e. again - it is property of file names, not particular completion context,
and logically should be implemented in _path_files. paths tag? Like for

> > 7. Backslash handling. So, that I do not forget it myself :-)
> I once said that this may be hard. But maybe it can be made simple:
> just convert all backslashes to slashes before completing >:->

Yes. For this reason I mentioned cygpath (that takes care of mount points as


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