From: Martin Richter <mrichter.list@googlemail.com>
To: zsh-users@zsh.org
Subject: context for globbing qualifiers based on command
Date: Mon, 27 Feb 2012 11:20:46 +0100 [thread overview]
Message-ID: <4F4B58FE.3070008@googlemail.com> (raw)
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)
next reply other threads:[~2012-02-27 10:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-27 10:20 Martin Richter [this message]
2012-02-29 18:22 ` Bart Schaefer
2012-02-29 18:28 ` Martin Richter
2012-02-29 18:59 ` Bart Schaefer
2012-02-29 18:32 ` Mikael Magnusson
2012-02-29 18:33 ` Mikael Magnusson
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=4F4B58FE.3070008@googlemail.com \
--to=mrichter.list@googlemail.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).