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

Re: _file in _zmodload: why option -/ ?

2013/10/27 06:37、Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> I'm not entirely sure, but its effect on _files is to cause symlinks
> that point to directories to be followed, so I presume it's to force
> symlinks in directories that contain modules to be offered alongside
> the modules that happen to be in the same directory.

In _files, there are lines of code (lines 66-69 and 79-82) which seem to be
commented out in 2001; see seq:15995
With this old code, if -/ is omitted, then both directories and symlinks to
directories would not be offered.

With the present code, however, I *guess* -/ can be omitted.
But there may be styles and options which could interfere with the option -/
and it may be safer to leave the option as is....

So I tried to modify my zstyle as, for example,

zstyle -e ':completion::*' file-patterns \
  '[[ $funcstack[1] = _files && $type =~ "^[^g]*/[^g]*$" ]] && reply=("*(-/)")'

which seems to solve my problem.

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