emacs-devel
[Top][All Lists]
Advanced

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

Nested sit-for's


From: Kim F. Storm
Subject: Nested sit-for's
Date: Wed, 16 Aug 2006 10:14:47 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Chong Yidong <address@hidden> writes:

>> What about the change that we discussed where nested sit-for calls
>> should not wait longer than any of the outer calls??
>
> I haven't had a chance to spend much time on this project.  One
> problem is that I haven't managed to find a simple test case that
> clearly demonstrates the old behavior is broken.
>

Try this evaluating this:

(defun st1 ()
  (with-current-buffer (get-buffer-create "*st1*")
    (goto-char (point-max))
    (insert "<")
    (sit-for 30)
    (insert ">")))

(run-with-timer 1 2 'st1)

(progn
  (message "sit-for...")
  (sit-for 5)
  (message "sit-for...done"))

Now, the sit-for...done message is shown after 30-35 seconds,
not after 5 seconds...

[repeat the last progn if you don't see the effect immediately]


The call to sit-for in the timer is probably "bad practice", but it
could just as well have happened in a process filter or some other
async handler.

-- 
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

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