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 20:15:23 +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>
>> Cc: address@hidden
>> Date: Wed, 09 May 2018 19:40:17 +0100
>> 
>> > Emacs considers itself idle only when it waits for input in its
>> > main loop.
>> 
>> Two follow-up questions (1) is this by design?
>
> I wasn't there when this was designed, but it certainly looks like
> that, because accept-process-output calls wait_reading_process_output
> in a way that avoids reading from keyboard or the rest of input
> events.

So that suggests that keyboard-idleness should be preserved while
waiting for subprocess output. But it's what you quoted next that
confuses me.

> An idle timer set for 600 seconds will run when ten minutes have
> elapsed since the last user command was finished, even if subprocess
> output has been accepted thousands of times within those ten minutes,
> and even if there have been garbage collections and autosaves.

Doesn't this contradict what you told me first?  I.e doesn't this
contradict the fact that this never returns?

  (catch 'done
    (run-with-idle-timer 600 nil (lambda () (throw 'done nil)))
    (while t (accept-process-output nil 0.1))) ; 6 thousand times

or should the manual be saying "even if subprocesses output has been
non-explictly accepted thousands of times"?

João




reply via email to

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