zsh-workers
 help / color / mirror / code / Atom feed
* Backrefs in zstyle patterns
@ 2015-05-01 15:45 Bart Schaefer
  2015-05-01 20:51 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Bart Schaefer @ 2015-05-01 15:45 UTC (permalink / raw)
  To: zsh-workers

About a year ago in users/18572, I proposed this:

    setopt extendedglob
    zstyle -e '(#b)(:completion:*)' matcher-list \
        'zstyle -a "word-$CURRENT$match" matcher-list reply'

I'm fairly sure that worked then, but now it doesn't, as in, the pattern is
never matched, not that $match is incorrect.

However, this --

    zstyle -e ':completion:(#b)(*)' matcher-list \
        'zstyle -a "word-$CURRENT:completion:$match" matcher-list reply'

-- does work, so it's not just that zstyle backrefs are borked in general,
and a leading (#b) in [[ xyz = (#b)(x*) ]] works as expected.  Any ideas
how this might have gone awry?  Does it work for someone else and just not
for me?

Here's the similar example that actually got me looking at this:

    zstyle -e '(#b)(:completion:*)' show-ambiguity \
        'zstyle -T "$match" list-colors && reply=(7)'

vs.

    zstyle -e ':completion:(#b)(*)' show-ambiguity \
        'zstyle -T ":completion:$match" list-colors && reply=(7)'

The former never matches, the latter matches and sets $match to "::::"

-- 
Barton E. Schaefer


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Backrefs in zstyle patterns
  2015-05-01 15:45 Backrefs in zstyle patterns Bart Schaefer
@ 2015-05-01 20:51 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2015-05-01 20:51 UTC (permalink / raw)
  To: zsh-workers

On Fri, 1 May 2015 08:45:52 -0700
Bart Schaefer <schaefer@brasslantern.com> wrote:
> About a year ago in users/18572, I proposed this:
> 
>     setopt extendedglob
>     zstyle -e '(#b)(:completion:*)' matcher-list \
>         'zstyle -a "word-$CURRENT$match" matcher-list reply'
> 
> I'm fairly sure that worked then, but now it doesn't, as in, the pattern is
> never matched, not that $match is incorrect.

See what's going into pattry() in lookupstyle() and whether p->prog
looks different from what you get from a conditional comparison, and
whether it got compiled with extendedglob properly.

pws


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-05-01 20:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-01 15:45 Backrefs in zstyle patterns Bart Schaefer
2015-05-01 20:51 ` Peter Stephenson

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).