Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Getting original words after _arguments
- X-seq: zsh-workers 31318
- From: Felipe Contreras <felipe.contreras@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Getting original words after _arguments
- Date: Sun, 21 Apr 2013 15:42:44 -0500
- Cc: zsh-workers@xxxxxxx, Felipe Contreras Garza <felipe.contreras@xxxxxxxxx>
- 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==
- In-reply-to: <130421115508.ZM6625@torch.brasslantern.com>
- 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
- References: <CAMP44s2UnDQ2TZsWJykVN5c+gNWbQtfQ8hTy_uPk=HdQBiRbfA@mail.gmail.com> <130420083634.ZM10866@torch.brasslantern.com> <CAMP44s0i+e0yNQ9AABQzF6Diqbgt1EQXj7gR-PMAOb+a+FQ_DA@mail.gmail.com> <130421115508.ZM6625@torch.brasslantern.com>
On Sun, Apr 21, 2013 at 1:55 PM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author