[Top][All Lists]

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

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

From: Eli Zaretskii
Subject: Re: run-with-timer vs run-with-idle-timer
Date: Wed, 09 May 2018 21:59:50 +0300

> 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

> (2) do interruptions by processes reset the idle time (I believe
> they should)?

If by "interruptions" you mean when output some sub-process comes our
way, then no.  The ELisp manual explicitly says:

     Emacs becomes “idle” when it starts waiting for user input, and it
  remains idle until the user provides some input.

Note the "user input" part.  And the very next paragraph says:

     Emacs can do various things while idle: garbage collect, autosave or
  handle data from a subprocess.  But these interludes during idleness do
  not interfere with idle timers, because they do not reset the clock of
  idleness to zero.  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.

reply via email to

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