zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: [Feature suggestion] (user configurable) timeout for generating completion lists
Date: Thu, 23 Jan 2014 17:16:59 -0800	[thread overview]
Message-ID: <140123171659.ZM19422@torch.brasslantern.com> (raw)
In-Reply-To: <CADdV=MsdfHUKDVy1dLbZ-d19cAEpGuDxzsKPd3Cy6imJ1Lo_8Q@mail.gmail.com>

On Jan 23,  1:04pm, Nikolai Weibull wrote:
}
} Time to delegate completion to a subprocess? That'd make it possible
} to use Zsh completions from outside the shell as well.

I just knew someone was going to say this.

Completion is very closely tied into ZLE, and ZLE is very closely tied
into the shell.  It's not going to turn into a readline library without
a complete rewrite.

On the other hand, the completion functions themselves are just shell
code, so it's possible to almost arbitrarily replace stuff they do inside
the shell with stuff that's done outside.  The current set of functions
in fact go to an inordinate amount of effort to do just the opposite, on
the assumption that forking and reading from pipes is more expensive /
time-consuming than doing internal string manipulation and globbing.

Back on the first hand, you might not gain much, because the compsys
model is to have the shell functions generate all possible strings in
the correct category and then let the internals filter them against the
contents of the command line.  This is what allows some of the really
powerful stuff like expanding c.u.q into comp.unix.questions.  If you
rely on an external process, you either lose that or duplicate the
effort of calculating it.

We've already seen the "do it externally" plan break down with the _git
issue discussed in the thread leading up to zsh-users/18321 (about which
we're sort of awaiting your input, Nikolai).

However, there are schemes like Thiago Padilha's zpty-based approach that
would allow a separate zsh to compute the completions in the background,
which would in turn allow the foreground zsh to ignore the results if they
didn't come back soon enough.  This is potentially duplication of effort,
and what you'd still lose there (unless you duplicate still more effort)
is file-type-based coloring or tagging and the like, which depend, e.g.,
upon ZLE having examined the filesystem.

But it's jumping the gun a little to discuss all of this before we even
know what's really causing the issue.


  reply	other threads:[~2014-01-24  1:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-20  7:13 Arseny Tolmachev
2014-01-22  8:04 ` Bart Schaefer
2014-01-23 12:04   ` Nikolai Weibull
2014-01-24  1:16     ` Bart Schaefer [this message]
2014-01-24  9:00       ` Nikolai Weibull
2014-01-25 20:09         ` _git and partial completion, again Bart Schaefer
2014-01-24 14:46       ` [Feature suggestion] (user configurable) timeout for generating completion lists Greg Klanderman
2014-01-25 20:49         ` Bart Schaefer
2014-01-29 16:29           ` Greg Klanderman
2014-02-25 15:35           ` Greg Klanderman
2014-01-22 13:51 ` Shawn Wilson

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=140123171659.ZM19422@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@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).