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

Re: Using CVS Completion Functions



Peter Stephenson sent me the following 1.9K:

> > Hi.  A few weeks ago I posted about trying to get a subset of cvs
> > completion for a script of mine.  This was the solution I came up with,
> > based on Peter's suggestion:
> > 
> >    _cvs_changed_files() {
> >      autoload +X _cvs
> >      _cvs_files_modified "$@" || _cvs_files "$@"
> >    }
> >    compdef _cvs_changed_files cvsvimdiff
> 
> _cvs_files_modfied and _cvs_files are within the _cvs function, so you
> have to load *and run* _cvs to acquire them, which I missed before.  This
> version of _cvs redefines _cvs to the real completion function when it
> runs.  Unfortunately, running it has the obvious effect of calling
> normal _cvs completion.  There is a truly horrible hack...

Thanks, Peter.  I think knowing that I need to invoke the _cvs
completion function before trying to complete cvsvimdiff is an
acceptable limitation.  I usually run "cvs -n update" first anyway, to
see what's changed.

-- 
Chris Johnson
cjohnson@xxxxxxxxxx
http://www.cs.utk.edu/~cjohnson



Messages sorted by: Reverse Date, Date, Thread, Author