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

Re: Using CVS Completion Functions



Peter Stephenson wrote:
> autoload +X _cvs
> functions[_cvs]=${functions[_cvs]%$'\n'*}
> _cvs
> 
> This removes the last line of the initial _cvs function, which happens
> to be the one that calls the redefined function.  As the function is
> still redefined, future cvs completion will still work fine.

I've missed one additional subtlety.  You don't want to do that when
_cvs is already loaded, so you need something like

if [[ $functions[_cvs] = "builtin autoload"* ]]; then
  autoload +X _cvs
  functions[_cvs]=${functions[_cvs]%$'\n'*}
  _cvs
fi

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


.



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