[darcs-devel] darcs patch: Zsh completion: support repos that use
_darcs/pristine
Georg Neis
gn at oglaroon.de
Sun Mar 4 07:36:10 PST 2007
* Eric Y. Kow <eric.kow at gmail.com> wrote:
> > Thu Mar 1 11:31:13 CET 2007 Georg Neis <gn at oglaroon.de>
> > * Zsh completion: support repos that use _darcs/pristine
>
> Looks ok to me. In it goes.
>
> Can you explain what are the advantages of the new zsh completion the
> old one, and why we have two versions?
zsh_completion_old uses the old completion system, which is based on the
"compctl" built-in (similar to tcsh's "complete" built-in).
zsh_completion_new uses the newer completion system, which is much more
powerful but, obviously, not supported by older (< 4) Zsh versions.
> Also, I could use some help integrating this into my .zsh, me of little
> man page reading. So far I've figured out that I need to do
> autoload -U compinit
> compinit
That should suffice.
> And that my zsh already has the (old) zsh completion distributed with
> it. How do I go about using the new one and why?
At least Zsh 4.3.2 comes with the new version. On my system (Debian),
it's installed as /usr/share/zsh/4.3.2/functions/Completion/Unix/_darcs.
Hence I didn't have to do anything to make Zsh use it.
I can't say much about the difference in functionality between the old
and new version. I've just tried to use the old one for the first time
and run into trouble:
Typing for instance "darcs record " and pressing TAB gives an error
instead of showing a list of repository-controlled files. Here's some
debugging output:
traal% darcs record +_darcs_rest:2> local first second prefix rest
+_darcs_rest:3> prefix=''
+_darcs_rest:4> read -c first second rest
+_darcs_rest:5> reply=+_darcs_rest:1> darcs record --list-option
darcs: setNonBlockingFD: invalid argument (Bad file descriptor)
+_darcs_rest:5> reply=+_darcs_rest:1> grep '^'
+_darcs_rest:5> reply=( )
For some reason,
darcs record --list-option | grep '^'
fails when called from within the completion function.
zsh_completion_new works fine.
Best regards,
Georg
--
If the shoe fits, buy the other one, too.
More information about the darcs-devel
mailing list