Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
context for globbing qualifiers based on command
- X-seq: zsh-workers 30302
- From: Martin Richter <mrichter.list@xxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: context for globbing qualifiers based on command
- Date: Wed, 29 Feb 2012 14:34:21 +0100
- Authentication-results: mr.google.com; spf=pass (google.com: domain of mrichter.list@xxxxxxxxxxxxxx designates 10.204.128.198 as permitted sender) smtp.mail=mrichter.list@xxxxxxxxxxxxxx; dkim=pass header.i=mrichter.list@xxxxxxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :x-enigmail-version:content-type:content-transfer-encoding; bh=a1wfeQrSdlRANM9eaFRbQlsejiRRsi+eTvStKBr+Ff8=; b=NlVRlQcMfQIDMSHtoDd9jx7fnTHA5oSaJoFzdiWZYTR2TfAuEGYOv5I+kmN1cfRrop plxqY6kD5cjSszC0BfcAIDvJkY8s3qLbeZi34LyuC7Ft1lTbPAhLRrPerlUx6eJGD+vi qHpdS2V9ixnnJV3ygXujE37abDqBQa1usJ9us=
- 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
Hi there,
unfortunately I'm not too well familiar with the syntax of zstyle and
setting appropriate contexts to achieve the following (although there
were quite some nice examples on this list now and then).
Suppose there is a function foo which we can use as a globbing qualifier
a la
print -l *(e:foo)
maybe even such that it takes an argument
print -l *(e:foo 5)
Is it possible to tweak the completion such that shell functions are
grouped at the top when pressing TAB when using (:e...) on a given command?
print -l *(e:TAB --> gives a lot of possible functions etc
but
special_command *(e:TAB
gives only shell function matching some regexp or gives only the single
function 'foo' or members of an array of functions?
Thanks,
Martin
PS: Just in case it is not clear what I mean by the above, here the
example I need it for: special_command needs filenames as arguments in
which two numbers appear. I now want to use only those files in which
the numbers have a certain sum (one could also think of product or
whatsoever)
So there are shell functions (aka the above `foo')
sum_equals
and
product_equals
and I want
special_command file_<->_<->.dat*(:TAB
to give only sum_equals and product_equals (or at least group them
together and show them at the top)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author