From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: rake completion with colons in their names
Date: Sun, 22 Apr 2012 19:05:50 +0100 [thread overview]
Message-ID: <20120422190550.1d0a0ce1@pws-pc.ntlworld.com> (raw)
In-Reply-To: <CANLTa0A+HBzmPJ5Bzhc3d9sH=x0bXE1zax8Qy-HsFq_Kp+Fzgw@mail.gmail.com>
On Sun, 22 Apr 2012 16:50:03 +0200
Benoit Daloze <eregontp@gmail.com> wrote:
> > It might be sensible to turn that target completion into a separate
> > function as a first step to make it clearer what's going on.
>
> How would you do that? Do you mean wrapping it in a function?
No, I mean turning this rather baroque expression that creates the array
"target" (and that I can't follow as it stands without detailed
investigation):
${${(f)"$(_call_program targets $words[1] -sT $opt_args[(I)(-N|--nosearch)] ${(kv)opt_args[(I)(-f|--rakefile)]} 2>/dev/null)"}/(#b)rake ([^ ]##) ##\# (*)/${${match[1]}//:/\\:}:${match[2]:l}}
into a function that assembles the completion. That might at least make
it obvious what's going on.
However, it might be worth seeing if replacing _describe as the function
to add the completions (just below that expression) helps. _describe
treats colons specially, and although the colons are being quoted with
backslashes in the expression above, I wouldn't be 100% sure this
actually has the right effect.
--
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/
prev parent reply other threads:[~2012-04-22 18:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-21 12:55 Benoit Daloze
2012-04-21 20:55 ` Peter Stephenson
[not found] ` <CANLTa0A+HBzmPJ5Bzhc3d9sH=x0bXE1zax8Qy-HsFq_Kp+Fzgw@mail.gmail.com>
2012-04-22 18:05 ` Peter Stephenson [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=20120422190550.1d0a0ce1@pws-pc.ntlworld.com \
--to=p.w.stephenson@ntlworld.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).