From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17983 invoked by alias); 7 Feb 2014 01:07:30 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 32358 Received: (qmail 20575 invoked from network); 7 Feb 2014 01:07:24 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <140206080443.ZM27528@torch.brasslantern.com> Date: Thu, 06 Feb 2014 08:04:43 -0800 X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: When you know completion will be slow ... MIME-version: 1.0 Content-type: text/plain; charset=us-ascii 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.