zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: "Zsh Hackers' List" <zsh-workers@zsh.org>
Subject: Re: Smarter matcher-list: skip previous sets
Date: Tue, 19 May 2015 15:55:06 -0700	[thread overview]
Message-ID: <150519155506.ZM12383@torch.brasslantern.com> (raw)
In-Reply-To: <555AF946.6010202@thequod.de>

On May 19, 10:50am, Daniel Hahler wrote:
}
} 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
} once?

Every (completer, matcher) pair might call different completion functions
or make different changes to the context.  _main_complete doesn't know
what the internals of a completer are going to do, so it has to make the
call for each possible pair.  It does attempt to break out of the loops
as soon as the exit status indicates that matches have successfully been
generated.

} If I understand it correctly, the possible results would be the same
} every time?

No, not necessarily.

} Where is the $_matcher used?
} Is it in Completion/Base/Core/_description, in the opts to compadd?

Yes, but also in _path_files.  More often _matcher_num is referenced,
so that completers that don't care about _matcher can become no-ops
after the first attempt.  Cf. Completion/Base/Completer/_menu 

} What would be a possible solution to improve handling with many
} completers/matchers?

There's no generic solution, this was discussed in agonizing detail
back when the completer/matcher loops in _main_complete (and in _prefix
and in _ignored) were put in place.  It's up to individual completers
or completion functions to avoid doing redundant work, which may be a
point that (a) should be made in the doc somewhere and (b) has been
forgotten in more recently-invented functions.


      reply	other threads:[~2015-05-19 22:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-18 22:11 Daniel Hahler
2015-05-19  0:44 ` Bart Schaefer
2015-05-19  8:50   ` Daniel Hahler
2015-05-19 22:55     ` Bart Schaefer [this message]

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=150519155506.ZM12383@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /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).