From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27482 invoked by alias); 21 Apr 2013 20:43:05 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 31318 Received: (qmail 1614 invoked from network); 21 Apr 2013 20:42:52 -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=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.215.44 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=gYWV+vbzKZp6AabxYGdEgsG35IgnftWkK2lMZ7z8ios=; b=uSIFMESwh0+IxI6nTaEegudyi1qP9EKp+sGv6Al3rIVKuzKupT21rZBkfMKjUjrLkN qt349KpSXMPRurbC+v5C6q/Xp3kmvezknTRW/bpyrkVTEtX7Dg5u0q4LJ87I+JQsLMce DzF0LZHKy/v9/h8JOv3ArpMNmOBH5olkiPEG163XgzeuQieRqIE8tT2VGXxuCCdOE/3B nkBUfpL7x9WVb4SCnzmymPYQO66EWrGqetr4sh3/PMOtIOWWJzNoavyRfRqiS0h06Dgf /97fRIaqsDlZW1znW9nhgpv8boyIR2Y0GJcbyg9grgeY6iXMrIiLEqxyXgy0+w+WRdZW Hpow== MIME-Version: 1.0 X-Received: by 10.112.140.100 with SMTP id rf4mr2840006lbb.82.1366576964868; Sun, 21 Apr 2013 13:42:44 -0700 (PDT) In-Reply-To: <130421115508.ZM6625@torch.brasslantern.com> References: <130420083634.ZM10866@torch.brasslantern.com> <130421115508.ZM6625@torch.brasslantern.com> Date: Sun, 21 Apr 2013 15:42:44 -0500 Message-ID: Subject: Re: Getting original words after _arguments From: Felipe Contreras To: Bart Schaefer Cc: zsh-workers@zsh.org, Felipe Contreras Garza Content-Type: text/plain; charset=UTF-8 On Sun, Apr 21, 2013 at 1:55 PM, Bart Schaefer wrote: > On Apr 20, 5:03pm, Felipe Contreras wrote: > } > } > Hmm. The variable named "words" is special to the completion system, and > } > if _arguments modifies it that probably means that later stuff is going > } > to depend on the state in which $words was left. You may confuse things > } > by stuffing $orig_words back into words. > } > } I know, I'm not going to usw zsh completion after that point. > > I'm sure you aren't, but the mix of user-function and built-in code in > the completion system means that there may be side-effects propagating > up to the caller of your function. I'm probably being overly paranoid. Yes you are. I know what the possible side-effects are, and I am knowingly avoiding them, it works perfectly fine, it's just not neat. > } > Is there some reason you can't just work on orig_words in the rest of > } > your function? > } > } It's not my code, it's git.git's bash completion, which uses 'word'. > > Aha. So you're using bashcompinit? No I'm not. > If not, you might want to look at > the _bash_complete function from there. I have, I've helped to write it. In fact, I'm probably the main contributor at this point. In fact, I'm aware of at least one bug for which I haven't managed to send the patch for. > Also, if there's a shortcoming > in zsh's git completion which is forcing you to use the one from bash, I > think there are a few people on this list who might want details. I already discussed the shortcomings in this list: http://thread.gmane.org/gmane.comp.shells.zsh.devel/22454/focus=22475 Basically it's dead slow, and Nikolai Weibull is opposed to make it usable. BTW. My zsh wrapper for git.git bash's completion is the official way git recommends completion for zsh, and it's distributed accordingly: https://git.kernel.org/cgit/git/git.git/tree/contrib/completion/git-completion.zsh And the folks of 'oh-my-zsh' are also thrilled of finally having completion that is not slow as a snail: https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/gitfast Cheers. -- Felipe Contreras