[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
run-with-timer vs run-with-idle-timer
From: |
João Távora |
Subject: |
run-with-timer vs run-with-idle-timer |
Date: |
Wed, 09 May 2018 18:34:41 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Hi
I suspect this one has been asked before, but still, why does this
return after 1 second:
(catch 'done
(run-with-timer 1 nil (lambda () (throw 'done nil)))
(while t (accept-process-output nil 0.1)))
And this never returns?
(catch 'done
(run-with-idle-timer 1 nil (lambda () (throw 'done nil)))
(while t (accept-process-output nil 0.1)))
Is it because accept-process-output means emacs isn't really idle?
Because it also fails with sleep-for and sit-for...
I need this because this (while t..) spin is a common way to wait for
async conditions (in this case the async condition is flymake kicking
in).
João
- run-with-timer vs run-with-idle-timer,
João Távora <=
Re: run-with-timer vs run-with-idle-timer, Thien-Thi Nguyen, 2018/05/10