From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: When you know completion will be slow ...
Date: Fri, 07 Feb 2014 08:14:22 -0800 [thread overview]
Message-ID: <140207081422.ZM28816@torch.brasslantern.com> (raw)
In-Reply-To: <20140207122141.5052dd75@pwslap01u.europe.root.pri>
On Feb 7, 12:21pm, Peter Stephenson wrote:
} Subject: Re: When you know completion will be slow ...
}
} Bart Schaefer <schaefer@brasslantern.com> wrote:
} > 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.
}
} Do you know about the show-completer style? It's not quite the same
} thing but by the same token that means you get information even if you
} don't know in advance completion's going to be slow.
I had forgotten about it, having played with it for a while way back when
you first added it and then left it alone.
I just tried it again and I find the context it displays is not specific
enough, but you're right that it does at least tell you that something is
happening.
However, using "zle -R" gives me bad behavior. Starting from Src/zsh -f:
------------
torch% autoload -U compinit; compinit -D
torch% _deliberately_slow() { sleep 5; return 1; }
torch% zstyle ':completion:*' completer _deliberately_slow _complete
torch% zstyle ':completion:*' show-completer yes
torch% ls
Trying completion for :completion::deliberately-slow::
------------
Becomes
------------
torch% ls
Config/ config.modules.sh Makefile
config.h config.status* Src/
config.log Doc/ stamp-h
config.modules Etc/ Test/
config.modules.local foo/
------------
and if I then press TAB again I get
------------
torch% ls
Trying completion for :completion::deliberately-slow::
config.h config.status* Src/
config.log Doc/ stamp-h
config.modules Etc/ Test/
config.modules.local foo/
------------
which then becomes
------------
torch% ls Config/
config.h config.status* Src/
config.log Doc/ stamp-h
config.modules Etc/ Test/
config.modules.local foo/
------------
Oops, the first line of the completion listing is not redrawn. This
does not happen with "zle -M".
prev parent reply other threads:[~2014-02-07 16:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-06 16:04 Bart Schaefer
2014-02-07 12:21 ` Peter Stephenson
2014-02-07 16:14 ` 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=140207081422.ZM28816@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).