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,FREEMAIL_FROM,
	T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :cc;
        bh=OPKg1MlCYW+wmQf2HzABWsp/234OQjnA/5ROrTC36Dc=;
        b=TFUlSh9WSISMaovUVcztankZdcwYh29WWO4DGfV1J/epdgW4JMB8S9JTZ6DBZX5UmY
         H+8E3d2Xcwy7nRfDqMI8AYPoRUDvrw+JYIiOPuPjyEMj7JEcY4FU6EX8qBWYKg82XlOE
         XIoPRalMjJiD5dB+Z4eF0U07acqNlsMBqVtN56j/oT/ixnaohordenXX7cu+ZF2tK2kB
         2NR4POwkFXN5M33Nlw8cR08QtlRdzTHUClFfUEDB4uzUvmEEtQL5sWbSg+cGrp7AXzLW
         Jbixv3fnbT2am+ux1ihe5cqj6buuOlbfacC2V1/flRMXcUkOahvvWe7pHycHyUYvA0D0
         HTPw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from:to:cc;
        bh=OPKg1MlCYW+wmQf2HzABWsp/234OQjnA/5ROrTC36Dc=;
        b=SEO8TnBoBmbBEMNdtcgW0g2oocNaWOW0wWpL76njPuitEA9HcQ+GbWTs3u+3xnPbLT
         sbhft4qqsiKjx17hKgkI9bMUcf6Yb7/Ghw6E6xDyxMvVdpxLtHTabNA03iftyf7FpKma
         cuDGow+JZsD+8zkBA3KV1i5K+x6iUczlDeb/Uecv46xIwAO+fCUrgH0Qt15kVFS6+h3e
         EtpqbFlT8Shu/U9jKuWQcBBfBDCCftHQRWIZfCe8tpAblKSK+PWyYcJlhS4jx+QtFX5k
         pbwevK1lXleOPNuGpuUAAW3yeWqRuBcyIlL8/puveS4TOE3w3rcoaImbpKjGGO0Uxmxc
         36Ag==
X-Gm-Message-State: AOPr4FW/Kk5d/z1Zb+mnFVLJXzh8+R+qQxZcvQbJCt9UKD8kcEa3zZG0VMvxUFm2NWXuwJcmvILZGQno4UlDzg==
MIME-Version: 1.0
X-Received: by 10.55.204.6 with SMTP id r6mr2886134qki.21.1460371641616; Mon,
 11 Apr 2016 03:47:21 -0700 (PDT)
In-Reply-To: <20160411112941.579d8157@pwslap01u.europe.root.pri>
References: <CAHYJk3TY5kU0fXDkk2iO7kRJhhMTS1f4a9Am1ueN4wCXOQ7Hsg@mail.gmail.com>
	<160410151105.ZM21544@torch.brasslantern.com>
	<20160411093738.11406966@pwslap01u.europe.root.pri>
	<CAHYJk3SEeghkbpLCE26bG_76nM5PYp9MF68AO1ue00DHTwRV6A@mail.gmail.com>
	<20160411112941.579d8157@pwslap01u.europe.root.pri>
Date: Mon, 11 Apr 2016 12:47:21 +0200
Message-ID: <CAHYJk3QkC_jDq94ax2vMZUCaU2iELFO7kk49ogQUg-qafDtgPA@mail.gmail.com>
Subject: Re: Allow slash in alternation patterns in limited cases?
From: Mikael Magnusson <mikachu@gmail.com>
To: Peter Stephenson <p.stephenson@samsung.com>
Cc: zsh workers <zsh-workers@zsh.org>
Content-Type: text/plain; charset=UTF-8
X-Seq: zsh-workers 38271

On Mon, Apr 11, 2016 at 12:29 PM, Peter Stephenson
<p.stephenson@samsung.com> wrote:
> 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.

Maybe I misunderstood your original point. I thought you meant making
(foo/bar|baz/bong) work in a glob would make it more incompatible with
pattern matching, but it already works there. So as far as I can see
if the change was possible, it would bring the two closer together,
not further apart. I only used the ~ example to mean that the part
after the ~ is a pattern match, not a glob, and uses the exact pattern
I wanted in the glob with the same results.

I guess the takeaway from the thread is that it's mostly not possible.

-- 
Mikael Magnusson

