all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "João Távora" <joaotavora@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: run-with-timer vs run-with-idle-timer
Date: Wed, 09 May 2018 21:59:50 +0300	[thread overview]
Message-ID: <838t8spsd5.fsf@gnu.org> (raw)
In-Reply-To: <87efikd65q.fsf@gmail.com> (message from João Távora on Wed, 09 May 2018 19:40:17 +0100)

> From: João Távora <joaotavora@gmail.com>
> Cc: emacs-devel@gnu.org
> 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.

> (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	other threads:[~2018-05-09 18:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-09 17:34 run-with-timer vs run-with-idle-timer João Távora
2018-05-09 18:10 ` Eli Zaretskii
2018-05-09 18:17 ` Eli Zaretskii
2018-05-09 18:40   ` João Távora
2018-05-09 18:59     ` Eli Zaretskii [this message]
2018-05-09 19:15       ` João Távora
2018-05-09 19:21         ` Eli Zaretskii
2018-05-09 19:34           ` João Távora
2018-05-09 20:00         ` Davis Herring
2018-05-09 20:18           ` João Távora
2018-05-10 11:46 ` Thien-Thi Nguyen
2018-05-10 12:28   ` João Távora
2018-05-10 18:50     ` Thien-Thi Nguyen
2018-05-11 10:39       ` João Távora
2018-05-11 11:05         ` João Távora
2018-05-12 17:57           ` Thien-Thi Nguyen
2018-05-12 17:37         ` Thien-Thi Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=838t8spsd5.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=joaotavora@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.