Zsh Mailing List Archive
Messages sorted by:
Re: Smarter matcher-list: skip previous sets
- X-seq: zsh-workers 35220
- From: Daniel Hahler <genml+zsh-workers@xxxxxxxxxx>
- To: Zsh Hackers' List <zsh-workers@xxxxxxx>
- Subject: Re: Smarter matcher-list: skip previous sets
- Date: Tue, 19 May 2015 10:50:14 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=thequod.de; h= content-transfer-encoding:content-type:content-type:in-reply-to :references:subject:subject:mime-version:user-agent:from:from :date:date:message-id:received:received; s=postfix2; t= 1432025414; bh=SuZcMyjcr4NHc1qC3C7gHjwhbSejCKuhEYmoJ7wUlC8=; b=a +txT2YG7wsddnz0WvoQ7uYfBLdiYQVpyN188CPecMOIaqeIpIGy9PiOSlmPXqWcX YuZ4V2A+CwG00QuN4ELlK5tFxXuZsyKGli119GxAWURi47bxgo6i2gmwt0HGRqu9 Wis00PpAa1E+aeEBnVYSGRUg85pYo0z8uPQAAEXW68=
- In-reply-to: <150518174424.ZM2337@torch.brasslantern.com>
- List-help: <mailto:firstname.lastname@example.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:email@example.com>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <555A63A4.firstname.lastname@example.org> <150518174424.ZM2337@torch.brasslantern.com>
-----BEGIN PGP SIGNED MESSAGE-----
On 19.05.2015 02:44, Bart Schaefer wrote:
> On May 19, 12:11am, Daniel Hahler wrote:
> } I've noticed that my matcher-list setup causes a (possibly expensive)
> } completion function to be called multiple times, although the input was
> } not changed by the matcher-list substitution.
> } I think it would be smart if these calls would be skipped in case the
> } input has not changed (because it was all lower-case in the beginning).
> Unfortunately the matcher-list is handled as a loop in the shell code in
> _main_complete, which has no way to tell whether the "input" is or is not
> "changed" by any particular matcher. You're assuming an implementation
> of matchers that doesn't (ahem) match what actually happens internally.
> Matchers don't "change" the input in any way; they alter the comparison
> of the input to the set of possible results, and each such comparison is
> independent of those that preceded it. The *output* may be changed based
> on which elements of the result set are selected.
But is it necessary then to call the completion function multiple times?
Couldn't the matchers just loop over the result that has been collected
If I understand it correctly, the possible results would be the same
every time? (at least that's the case for the expensive completion
function, where I've noticed it).
Where is the $_matcher used?
Is it in Completion/Base/Core/_description, in the opts to compadd?
What would be a possible solution to improve handling with many
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
-----END PGP SIGNATURE-----
Messages sorted by: