Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Backrefs in zstyle patterns



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



Messages sorted by: Reverse Date, Date, Thread, Author