Zsh Mailing List Archive
Messages sorted by:
Re: [PATCH] Add zsh/re2 module with conditions
- X-seq: zsh-workers 39247
- From: Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>
- To: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- Subject: Re: [PATCH] Add zsh/re2 module with conditions
- Date: Thu, 8 Sep 2016 17:48:09 -0400
- Cc: zsh-workers@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d201608; h=In-Reply-To:Content-Type:MIME-Version:References :Message-ID:Subject:Cc:To:From:Date; bh=tw3a0ZKAeuJbrhtMzYIG4mUZLHZkNdCBFNXqqzKAlCk=; b=vxporv+rwYGaKljKf6XRHw5eUn HN5gXzSh7pmx6CpnmQKPHnxImQc+AzWW90P9WhUZ/d0G+x6ZnIQ7YSSQaFqC+pRTW/cPaeodaoZcB 94b68cCpP9cWQORCLLDJtdFts+6PdwUWifPLDZSk5ETW5EnabpmdxduLZ3nQy5E4j659Drx+BAd0/ I/Cv+tbnyoGnWcS+Mxtw9roET19Y;
- In-reply-to: <firstname.lastname@example.org>
- List-help: <mailto:email@example.com>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Openpgp: url=https://www.security.spodhuis.org/PGP/keys/0x4D1E900E14C1CC04.asc
- References: <20160908041556.GA8401@breadbox.private.spodhuis.org> <email@example.com>
On 2016-09-08 at 23:14 +0200, Oliver Kiddle wrote:
> Phil Pennock wrote:
> > At this point, I haven't done anything about rebinding =~ to handle
> > this. It's purely new infix-operators based on words. I'm thinking
> > perhaps something along the lines of $zsh_reop_modules=(regex), with
> > `setopt rematch_pcre` becoming a compatibility interface that acts as
> > though `pcre` were prepended to that list and
> > zsh_reop_modules=(pcre regex)
> > having the same effect. Then I could use `zsh_reop_modules=(re2 regex)`.
> > Does this seem sane? Anyone have better suggestions? I do want to have
> If the first listed module in the array has control of =~, what is
> the meaning of subsequent ones?
Ignored, as long as the first one could be loaded.
The first loadable one gets =~
It's bound and tied at that point.
If the variable is re-assigned to, the shell would try again to work
through the list.
> How about perhaps using a module alias so you would do, e.g.
> zmodload -A zsh/default/regex=zsh/re2
Would probably need to be more than that, to be able to alias explicit
features. It's C: infix-conditionals which need to be grabbed, a
different one from each module.
Description: Digital signature
Messages sorted by: