Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham
	autolearn_force=no version=3.4.1
X-AuditID: cbfec7f4-f796c6d000001486-27-570b7c98ac41
Date: Mon, 11 Apr 2016 11:29:41 +0100
From: Peter Stephenson <p.stephenson@samsung.com>
To: zsh workers <zsh-workers@zsh.org>
Subject: Re: Allow slash in alternation patterns in limited cases?
Message-id: <20160411112941.579d8157@pwslap01u.europe.root.pri>
In-reply-to:
 <CAHYJk3SEeghkbpLCE26bG_76nM5PYp9MF68AO1ue00DHTwRV6A@mail.gmail.com>
References:
 <CAHYJk3TY5kU0fXDkk2iO7kRJhhMTS1f4a9Am1ueN4wCXOQ7Hsg@mail.gmail.com>
 <160410151105.ZM21544@torch.brasslantern.com>
 <20160411093738.11406966@pwslap01u.europe.root.pri>
 <CAHYJk3SEeghkbpLCE26bG_76nM5PYp9MF68AO1ue00DHTwRV6A@mail.gmail.com>
Organization: Samsung Cambridge Solution Centre
X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu)
MIME-version: 1.0
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7bit
X-Brightmail-Tracker:
 H4sIAAAAAAAAA+NgFjrPLMWRmVeSWpSXmKPExsVy+t/xa7ozarjDDc7vlLQ42PyQyYHRY9XB
	D0wBjFFcNimpOZllqUX6dglcGSevahb8Yqv4/+UWUwPjMdYuRk4OCQETiYPNq5khbDGJC/fW
	s3UxcnEICSxllPh3tQvKmcEkce1RGwuEc45RYtKd74wQzllGifX//rF3MXJwsAioSuzf5Qsy
	ik3AUGLqptmMILYIULj5+z8WEFtYwEni1cOzbCA2r4C9xLyZt9lBbE6BYIkrBw+CxYUE/jNK
	TLtZD2LzC+hLXP37iQniPHuJmVfOMEL0Ckr8mHwPbCazgJbE5m1NrBC2vMTmNW+ZIeaoS9y4
	u5t9AqPwLCQts5C0zELSsoCReRWjaGppckFxUnquoV5xYm5xaV66XnJ+7iZGSDB/2cG4+JjV
	IUYBDkYlHl6Ha1zhQqyJZcWVuYcYJTiYlUR4X+VzhwvxpiRWVqUW5ccXleakFh9ilOZgURLn
	nbvrfYiQQHpiSWp2ampBahFMlomDU6qB0e5f/7wLbVNe+QQ4LLgzs1Px+cSlRRU9k5Y1x9he
	nrG1ZqlM5noe7aR7cm63tGpWax3emrxGUeCE2d+eG4EfZG5tc2z698r50IoLe0V2adz7VKa+
	VLX3R1nE+Rzub2xXhDiMZp70exG71PvjDilBxtBWldJy1qY+7v2JCd8UswN6RUyaanaoK7EU
	ZyQaajEXFScCACslbG1iAgAA
X-Seq: zsh-workers 38270

On Mon, 11 Apr 2016 12:22:49 +0200
Mikael Magnusson <mikachu@gmail.com> 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

