Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Calling a zle widget from a function
- X-seq: zsh-users 11555
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Calling a zle widget from a function
- Date: Tue, 12 Jun 2007 18:51:53 +0100
- In-reply-to: <20070612173249.GO14435@xxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20070612144404.GN14435@xxxxxxxxxxxxxxxxxxxx> <200706121514.l5CFEaH5029180@xxxxxxxxxxxxxx> <20070612173249.GO14435@xxxxxxxxxxxxxxxxxxxx>
Angel Olivera wrote:
> Now, for every prompt that is printed I get a new sched job queued.
> This might get as big as 3600 or more. Do you think that is going to
> be a serious performance penalty on my daily zsh routine?
That's because you're running the "sched" unconditionally to schedule
a new task, even if the function is called from precmd. It would
definitely be better to avoid that. You can delete any existing
scheduled job with something like:
sched | while read line; do
if [[ $line = *clear-zle-screen* ]]; then
sched -${line%% *}
fi
done
(It would be nice if sched provided an array to access scheduled events
but it doesn't. That's an easy tweak I may look at.)
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php
To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview
Messages sorted by:
Reverse Date,
Date,
Thread,
Author