zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: When you know completion will be slow ...
Date: Thu, 06 Feb 2014 08:04:43 -0800	[thread overview]
Message-ID: <140206080443.ZM27528@torch.brasslantern.com> (raw)

Completion functions that are going to perform potentially slow operations
(e.g., "git ls-files" is unpredictable on large repos, or the example from
recently on zsh-users of "system_profiler -listDataTypes") could warn the
user that there will be a delay.

The "zle -M" command works from inside a completion widget, and will erase
the completion listing (which is then redrawn), so it could be used to
display a message just before the long operation begins.  Unfortunately it
is not "safe to call" in the way that "zle -R" is, so may need to test that
zle is active with "zle && zle -M ..." ("zle -R" also works, but covers up
the first line of the completion listing which is then never redrawn).

This seems to interoperate safely with menu-selection as well.  If this is
deemed a good idea, we might want to document a standard zstyle name for it
so it can be turned on/off for properly written completion functions.


             reply	other threads:[~2014-02-07  1:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-06 16:04 Bart Schaefer [this message]
2014-02-07 12:21 ` Peter Stephenson
2014-02-07 16:14   ` 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=140206080443.ZM27528@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).