emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: run-with-timer vs run-with-idle-timer


From: João Távora
Subject: Re: run-with-timer vs run-with-idle-timer
Date: Wed, 09 May 2018 19:40:17 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> From: João Távora <address@hidden>
>> Date: Wed, 09 May 2018 18:34:41 +0100
>> 
>>   (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?

> More accurately, because Emacs is never idle for more than 0.1 sec,
> and you requested the timer to run after 1 sec of idleness.> 
>
> ...
>
> Actually, yes, waiting in accept-process-output doesn't count as being
> idle.

Right. Ditto for sit-for and sleep-for, btw

> Emacs considers itself idle only when it waits for input in its
> main loop.

Two follow-up questions (1) is this by design? (2) do interruptions by
processes reset the idle time (I believe they should)?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]