Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: _approximate doesn't work
- X-seq: zsh-workers 24571
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: _approximate doesn't work
- Date: Tue, 19 Feb 2008 10:19:04 +0000
- In-reply-to: <080219002936.ZM16243@xxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- Organization: CSR
- References: <200802171925.m1HJPbE8009696@xxxxxxxxxxxxxxxxxxx> <080218013338.ZM15026@xxxxxxxxxxxxxxxxxxxxxx> <080219002936.ZM16243@xxxxxxxxxxxxxxxxxxxxxx>
On Tue, 19 Feb 2008 00:29:35 -0800
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> The problem is that at the line above in _path_commands, PREFIX is
> always "xsane_g" (using PWS's test) and never "(#a1)xsane_g".
>
> Looking through the output, PREFIX gets set by the replacement compadd
> created via _approximate -- but that doesn't happen until *inside* the
> call to _wanted, long after the test in _path_commands.
You're right this is happening quite late, and I think PREFIX is being
restored automatically (by the compstate[restore]=auto mechanism), which is
what I missed (a previously modified version of PREFIX wouldn't be picked
up).
However, this is an extremely general problem. Very many completion
functions assume quite reasonably that testing PREFIX tests what the
completer is trying to match.
Perhaps we need to make approximation/correction more visible by
introducing parameters that are local to the completion system and only
contain text in the appropriate case (e.g. APPROX="(#a1)")?
--
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