Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Using CVS Completion Functions
- X-seq: zsh-users 11673
- From: Peter Stephenson <pws@xxxxxxx>
- Subject: Re: Using CVS Completion Functions
- Date: Wed, 25 Jul 2007 17:24:18 +0100
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <200707251610.l6PGAjhH024852@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20070725135652.GA3921@xxxxxxxxxxxxxxxxxx> <200707251610.l6PGAjhH024852@xxxxxxxxxxxxxx>
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