zsh-workers
 help / color / mirror / code / Atom feed
From: Phil Pennock <zsh-workers+phil.pennock@spodhuis.org>
To: Oliver Kiddle <okiddle@yahoo.co.uk>
Cc: zsh-workers@zsh.org
Subject: Re: [PATCH] Add zsh/re2 module with conditions
Date: Thu, 8 Sep 2016 17:48:09 -0400	[thread overview]
Message-ID: <20160908214809.GA12371@breadbox.private.spodhuis.org> (raw)
In-Reply-To: <9404.1473369244@hydra.kiddle.eu>

[-- Attachment #1: Type: text/plain, Size: 1240 bytes --]

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.

-Phil

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

  reply	other threads:[~2016-09-08 21:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-08  4:15 Phil Pennock
2016-09-08 13:56 ` [PATCH] re2: fix clean-up path; fix two comments Phil Pennock
2016-09-08 21:14 ` [PATCH] Add zsh/re2 module with conditions Oliver Kiddle
2016-09-08 21:48   ` Phil Pennock [this message]
     [not found] ` <20160908144203.GA28545@fujitsu.shahaf.local2>
     [not found]   ` <20160908204737.GA12164@breadbox.private.spodhuis.org>
     [not found]     ` <20160908211643.GA4432@fujitsu.shahaf.local2>
     [not found]       ` <20160909005557.GB12371@breadbox.private.spodhuis.org>
     [not found]         ` <20160909045739.GA6623@fujitsu.shahaf.local2>
     [not found]           ` <20160910010456.GA85981@tower.spodhuis.org>
     [not found]             ` <20160910190924.GB4045@fujitsu.shahaf.local2>
2016-09-11 19:23               ` zsh/re2 : avoid until further notice Phil Pennock
2016-09-11 19:27                 ` Phil Pennock
2016-09-12  3:50                 ` Daniel Shahaf
2016-09-14 18:47                   ` Phil Pennock

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160908214809.GA12371@breadbox.private.spodhuis.org \
    --to=zsh-workers+phil.pennock@spodhuis.org \
    --cc=okiddle@yahoo.co.uk \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).