unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@stupidchicken.com>
Cc: Noah Friedman <friedman@splode.com>, emacs-devel@gnu.org
Subject: Re: sit-for and idle timers
Date: Mon, 14 Aug 2006 16:05:58 -0400	[thread overview]
Message-ID: <87irkvxeu1.fsf@stupidchicken.com> (raw)
In-Reply-To: <87odun6qx0.fsf@stupidchicken.com> (Chong Yidong's message of "Mon, 14 Aug 2006 15:47:07 -0400")

>> That is definitely not right.  Emacs really is idle when it reads an event,
>> even if there is a timeout.
>>
>> So my conclusion is that when read-event is called from an idle timer,
>> it should not change the state to idle at the beginning, and it should
>> not change the state away from idle at the end.
>
> I already checked in a different change to keyboard.c before your
> email came in.  But I think your version makes more sense.

I just thought of one inconsistency, though.  Suppose Emacs is not
idle, and is running Lisp code that calls sit-for.  With your change,
this starts idle timers:

!   if (! already_idle)
!     timer_start_idle ();

This is inconsistent with the old (built-in) behavior of sit-for,
which did not activate idle timers while waiting either.  The
reasoning, I think, is that `sit-for' means for the Lisp code to
"spin" for that period of time or until input arrives, which is not
the same as idling.  (This is similar to why `sleep-for' does not run
idle timers.)

If this is the intended behavior, then read-event with a timeout
should not start idle timers, since it only exists to be called by
sit-for.  We could simply document this behavior in the lispref
manual.

  reply	other threads:[~2006-08-14 20:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-11 19:48 sit-for and idle timers Noah Friedman
2006-08-11 21:00 ` Chong Yidong
2006-08-14 18:34 ` Chong Yidong
2006-08-14 19:20 ` Richard Stallman
2006-08-14 19:47   ` Chong Yidong
2006-08-14 20:05     ` Chong Yidong [this message]
2006-08-15 12:41       ` Richard Stallman
2006-08-15 20:12         ` Chong Yidong
2006-08-16 19:27           ` Richard Stallman
2006-08-16 19:38             ` Chong Yidong

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87irkvxeu1.fsf@stupidchicken.com \
    --to=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=friedman@splode.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).