From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk
Subject: Re: _approximate doesn't work
Date: Tue, 19 Feb 2008 10:19:04 +0000 [thread overview]
Message-ID: <20080219101904.010f8df8@news01> (raw)
In-Reply-To: <080219002936.ZM16243@torch.brasslantern.com>
On Tue, 19 Feb 2008 00:29:35 -0800
Bart Schaefer <schaefer@brasslantern.com> 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@csr.com> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
next prev parent reply other threads:[~2008-02-19 10:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200802171925.m1HJPbE8009696@pws-pc.ntlworld.com>
[not found] ` <080218013338.ZM15026@torch.brasslantern.com>
2008-02-19 8:29 ` Bart Schaefer
2008-02-19 10:19 ` Peter Stephenson [this message]
2008-02-19 22:22 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080219101904.010f8df8@news01 \
--to=pws@csr.com \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).