From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3973 invoked by alias); 22 Apr 2012 18:06:03 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17024 Received: (qmail 6580 invoked from network); 22 Apr 2012 18:06:01 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: neutral (ns1.primenet.com.au: 209.85.212.171 is neither permitted nor denied by SPF record at ntlworld.com) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-proxyuser-ip:date:from:to:subject:message-id:in-reply-to :references:x-mailer:mime-version:content-type :content-transfer-encoding:x-gm-message-state; bh=q/kzxJNVGX05goKKX4cWTAYV7gUq6GiBc8eG28IAc84=; b=aHlYiZdGzjdR/3eIR+dU+18cEThKXd5mV1LJ4k55uCsbawbLcb1fgVUEWgJyTEWub8 7WMqSTPrYlQbLnnpLNgTvlNFqKUb8x2PYMfzp1XOqXEFpmBg77b8Gmdt+MkPKM03++hB 7lFweUWU3I3jJg4GtvPqzK5MxwjXpgd9QeQnMtcv+k9BGyf0Lf4kz46ucHd6Cytzxlmn P0BNtfyC87FhajqSVzOO6ccnNflJ4AOAQOMDgoxStJ+phcii4WSsSLWgcickVtuV44hg x7YP1Hn+Su7euYzbMdXi/IvySye6U0fhGjOUwJBCu05G/1/kCPwkvfwbN6OfKmU3CDKy lHKQ== X-ProxyUser-IP: 86.6.29.42 Date: Sun, 22 Apr 2012 19:05:50 +0100 From: Peter Stephenson To: Zsh Users Subject: Re: rake completion with colons in their names Message-ID: <20120422190550.1d0a0ce1@pws-pc.ntlworld.com> In-Reply-To: References: <20120421215549.702ffb58@pws-pc.ntlworld.com> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQnobZoSGe+PQF4CyHSGhyDfknpA10IR65iop31+l3Nc5w+jiufvqo2vXke8soDpGIWYfaYc On Sun, 22 Apr 2012 16:50:03 +0200 Benoit Daloze 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 Web page now at http://homepage.ntlworld.com/p.w.stephenson/