unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@stupidchicken.com>
Cc: emacs-devel@gnu.org
Subject: Re: sit-for and idle timers
Date: Fri, 11 Aug 2006 17:00:18 -0400	[thread overview]
Message-ID: <87bqqr6l99.fsf@stupidchicken.com> (raw)
In-Reply-To: <20060811124841.840381.FMU5696@piglet.prv.splode.com> (Noah Friedman's message of "Fri, 11 Aug 2006 12:48:41 -0700 (PDT)")

Noah Friedman <friedman@splode.com> writes:

> The less simple solution is probably for sit-for to go back to using
> a timer itself.

The reason for not using a timer is so that when a process filter runs
during the sit-for, the expiry of the sit-for won't interrupt the
filter (which might be waiting for keyboard input).  Otherwise,
process filters can't reliably call input reading functions.  See the
thread labelled "a bug of read-passwd" from July.

> One solution to this problem is to bind timer-idle-list to nil while
> calling read-event.

This would inhibit all other idle timers from running during the
sit-for.  But jit-lock-stealth-fontify, for example, sits for 30
seconds, and I don't think we want to inhibit other idle timers during
this entire period.

> The problem is that read-event's call tree ultimately results in
> calling keyboard.c:read_char, which calls timer_start_idle.  This
> resets the activation time for all the current idle timer events,
> which means that any function on an idle timer which calls sit-for
> is now getting scheduled to be run recursively if another interval
> of the appropriate length ensues.

I think the solution is to avoid calling timer_start_idle when
read-event is given a non-nil SECONDS argument.  What do people think?

  reply	other threads:[~2006-08-11 21:00 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 [this message]
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
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=87bqqr6l99.fsf@stupidchicken.com \
    --to=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    /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).