zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: Setting the 'completer' style - _match and **
Date: Tue, 20 Sep 2016 08:46:07 -0700	[thread overview]
Message-ID: <160920084607.ZM31623@torch.brasslantern.com> (raw)
In-Reply-To: <20160920085431.GA3720@fujitsu.shahaf.local2>

On Sep 20,  8:54am, Daniel Shahaf wrote:
}
} [ Your MUA seems to have changed the subject: your email has a hyphen
} where the email you reply to had an em dash. ]

Sorry about that; mail to my home desktop passes through a number of
gateways and processing steps, some of which think non-ascii subjects
are potential spam indicators.

} > } The idea is that if a pattern contains "**" then _match('s wrapper) will
} > } leave it for _expand to process.
} > 
} > You could probably come up with a "zstyle -e" formulation that would only
} > include_match in the completer value in the right circurmstances.
} 
} How would I do that?  I think the "right circumstances" are [[ $curtag
} == *(file|dir)* ]], but the 'completer' style is looked up under the
} context :completion:::::, before tags are known.

I was thinking quite literally what you said about the pattern:

zstyle -e ':completion:*' completer \
  '[[ $PREFIX$SUFFIX == *[*][*]* ]] && reply=(... _expand ...) || \
    reply=(... _match ...)'

But you could add to the [[ ]] e.g. "&& $words[1] == service" (the
value of $service hasn't been set yet there either because it's a
feature of _complete).


      reply	other threads:[~2016-09-20 15:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-12 23:30 Setting the 'completer' style — " Daniel Shahaf
2016-09-19 14:45 ` Setting the 'completer' style - " Bart Schaefer
     [not found] ` <160919074515.ZM28018__10595.0927398682$1474296416$gmane$org@torch.brasslantern.com>
2016-09-20  8:54   ` Daniel Shahaf
2016-09-20 15:46     ` Bart Schaefer [this message]

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=160920084607.ZM31623@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@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).