Subject: Re: Allow slash in alternation patterns in limited cases?
From: Peter Stephenson <[email-masked]>
To: zsh workers <[email-masked]>
Date: Mon, 11 Apr 2016 11:29:41 +0100
List-Id: Zsh Workers List <zsh-workers.zsh.org>

On Mon, 11 Apr 2016 12:22:49 +0200
Mikael Magnusson <[email-masked]> wrote:
> > But this is
> > going to be inconsistent with pattern matching one way or another.  So a
> > different syntax would be more sensible.
> 
> Doesn't this already work as is with pattern matching? Eg, I could do
> /path/to/**/*~^(/path/to/a/dir/*|/path/to/some/other/files/*)
> even though that would be insanely inefficient, especially when
> /path/to is just /.

"~" is already handled specially: we pass in a flag to say we're at top
level so just keep going if you find a "/" after a "~".  This is much
easier as once we've seen the ~ we can relax --- no more handling of
individual directories is needed as we're going to apply the exclusion
in one go at the end (hence the suggestion of the new option to prune
directories).  This has always been the documented way in this case.

pws