zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Backrefs in zstyle patterns
Date: Fri, 1 May 2015 08:45:52 -0700	[thread overview]
Message-ID: <150501084552.ZM3199@torch.brasslantern.com> (raw)

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


             reply	other threads:[~2015-05-01 15:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-01 15:45 Bart Schaefer [this message]
2015-05-01 20:51 ` Peter Stephenson

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=150501084552.ZM3199@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --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).