Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Getting original words after _arguments



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