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

Re: _file in _zmodload: why option -/ ?



On Oct 28,  1:10am, Jun T. wrote:
} Subject: Re: _file in _zmodload: why option -/ ?
}
} 2013/10/27 06:370x3001Bart 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
} http://www.zsh.org/mla/workers/2001/msg02656.html
} With this old code, if -/ is omitted, then both directories and symlinks to
} directories would not be offered.

Right.  On closer inspection, the -/ is needed only when one of the styles
file-patterns or list-dirs-first is used; -/ is redundant in the default
case because that test is commented out.

} 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.

Of course, you only have this problem because you disagree with the
conclusion reached in workers/15995.  There probably ought to be yet
another zstyle that controls the default use of directories.



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