emacs-devel
[Top][All Lists]
Advanced

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

Re: sit-for and idle timers


From: Chong Yidong
Subject: Re: sit-for and idle timers
Date: Mon, 14 Aug 2006 14:34:49 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Noah Friedman <address@hidden> writes:

> The change to sit-for of 2006-07-26 ("Use new SECONDS arg of read-event
> instead of a timer") seems to cause problems with idle-timers
> which call sit-for.

This should now be fixed.

> Here's a small test case which demonstrates the problem:
>
>     (defvar itimer-test-wait 0.5)
>     (defvar itimer-test-depth 0)
>
>     (defun itimer-test ()
>       (setq itimer-test-depth (1+ itimer-test-depth))
>       (unwind-protect
>           (let ((flag nil))
>             (while (sit-for itimer-test-wait)
>               (setq flag (not flag))
>               (message "itimer-test-depth: %-3d%s"
>                        itimer-test-depth
>                        (if flag " (blink)" ""))))
>         (setq itimer-test-depth (1- itimer-test-depth))
>         (message "itimer-test-depth: %d" itimer-test-depth)))
>
>     (run-with-idle-timer 0.25 t 'itimer-test)
>
> In the pre-7/26 implementation, this timer should never print a depth
> greater than 1, and the "(blink)" text should blink on and off with a
> regular rhythm.




reply via email to

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