Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Backrefs in zstyle patterns
- X-seq: zsh-workers 35012
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Backrefs in zstyle patterns
- Date: Fri, 1 May 2015 08:45:52 -0700
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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