zsh-workers
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh-workers@zsh.org, Felipe Contreras Garza <felipe.contreras@gmail.com>
Subject: Re: Getting original words after _arguments
Date: Sun, 21 Apr 2013 15:42:44 -0500	[thread overview]
Message-ID: <CAMP44s2=gwZ2jAO761adzQF-pwi50ZtqZs6wTSAYvSETYaKLpQ@mail.gmail.com> (raw)
In-Reply-To: <130421115508.ZM6625@torch.brasslantern.com>

On Sun, Apr 21, 2013 at 1:55 PM, Bart Schaefer
<schaefer@brasslantern.com> 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


      reply	other threads:[~2013-04-21 20:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-19  8:21 Felipe Contreras
2013-04-20 15:36 ` Bart Schaefer
2013-04-20 20:07   ` Peter Stephenson
2013-04-20 22:03   ` Felipe Contreras
2013-04-21 18:55     ` Bart Schaefer
2013-04-21 20:42       ` Felipe Contreras [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='CAMP44s2=gwZ2jAO761adzQF-pwi50ZtqZs6wTSAYvSETYaKLpQ@mail.gmail.com' \
    --to=felipe.contreras@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@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).