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,T_DKIM_INVALID
	autolearn=ham autolearn_force=no version=3.4.1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=brasslantern-com.20150623.gappssmtp.com; s=20150623;
        h=from:message-id:date:to:subject:mime-version;
        bh=aDlBz3C7UPehc3ChztEsJONbVh65TSJnqLPhHK2uVF8=;
        b=yt/kR8re1SXDq5ybuEig6U3m4oC5tBp6g6XM6O1lYMDNWmlnZ+eGV+n5gCapLgUd0I
         XNLKd6YmMJNO3+HpJ9t/nPY1or+VFlpBP91eQ1ozTYoWdMLPOEp/Xf8xS/KW/hML9rmo
         WZX7P3pZ40/ut4C5ARp4F2rFiiqFNJTtJJHdKZuCyYJ3wI6a48t/B9rWj0mPCTBGQQLA
         P/UuVkI1dC8PSdYJZqKXmz4vMYMfO88VNGbT7jiCl1xfnf8VTQdfklx2sjEe/P9jeNNj
         lqfHt7qh/VITFGd7RR65UCYylffZ2aDZrI3BCVzvIK5NZ1hh0hixFs/uP1LLtwqQa7tl
         bMWw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:message-id:date:to:subject:mime-version;
        bh=aDlBz3C7UPehc3ChztEsJONbVh65TSJnqLPhHK2uVF8=;
        b=SCcmds0sJPDUTCV1AjbLij9qgBsTets3kbvdCvO85cOP0Uxv5Xaqrhc660h3bxmshY
         vwmmKjep6Xwl88ZEYPtEamxIyqSgX3X8l+Kwo/yD+U94S+zrssh2KEgD5vpk7OWwUBZQ
         uUlpT/WYdXp65f8qaIDCImv5XEs9XziqTEJnvnOf+LcBpXzmeuCVXQuGJVfSxiTu9nnQ
         8oMV8Azl3sXkhdqvzO/wfHA4uTnVVJaAXbE/Y22MduIURVG06F322JfiOpiY/j1QxIOV
         WYcGXETSsAOpDz/GY0impXCHLjsLXkRmpVGm5FVjVl5AyqlQUKBJt0upIT/WBJGlfQdN
         rtzg==
X-Gm-Message-State: AOPr4FW0LlppywNUVx1Hj0+YcQ94JqL9YvE4AIbbaVBXdsZzVn39GStiIAr6ldwIDSHU8w==
X-Received: by 10.98.87.15 with SMTP id l15mr5708267pfb.16.1461086260377;
        Tue, 19 Apr 2016 10:17:40 -0700 (PDT)
From: Bart Schaefer <schaefer@brasslantern.com>
Message-Id: <160419101751.ZM31673@torch.brasslantern.com>
Date: Tue, 19 Apr 2016 10:17:51 -0700
X-Mailer: OpenZMail Classic (0.9.2 24April2005)
To: zsh-workers@zsh.org
Subject: EXTENDED_PATTERNS option?
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Seq: zsh-workers 38298

I have made no coding progress at all on the suggestion I'm about to make,
but for purposes of discussion:

Might it be sensible to separate the EXTENDED_GLOB features into two
contexts?  Namely, filename generation and pattern matching, so that for
example one could have backreferences enabled in [[ ... ]] expressions
while at the same time NOT have "^" and "#" take on special meaning in
globbing.

Thus the suggestion that EXTENDED_PATTERNS enables (#s), (#e), (#m), etc.
in conditional expressions, whereas EXTENDED_GLOB behaves as it now does
(implying EXTENDED_PATTERNS).

[An alternative worth careful consideration is to have EXTENDED_PATTERNS
active by default, and use EXTENDED_GLOB only during filename generation.
There is a small chance that some conditionals in existing code would
change behavior if this were done.]

One complication to this of course is that (#q) now turns on globbing
inside conditionals, and the (e::) glob flag evaluates conditionals, so
flipping global state of the pattern code on entry/exit of either context
is fraught with potential confusion -- perhaps so much so as to scuttle
the idea.

Any thoughts?

Aside:  Rope to hang yourself:  [[ -f  *(#qe:unsetopt extendedglob:) ]]

Aside part 2:  Why doesn't (#q) work to cause globbing in [[ x = y ]] ?
The doc says "it can be forced in any case where normal shell expansion
is valid" but what does that mean inside a conditional?

