Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X

From: Dmitry Gutov <[email-masked]>
Date: Wed, 19 Sep 2012 04:27:07 +0400

On 18.09.2012 19:05, Eli Zaretskii wrote:
> The patch below makes your simplified recipe, viz.:
>
>    (defvar counter 0)
>
>    (defun foo ()
>      (message (format  "foo %s" counter))
>      (setq counter (1+ counter))
>      (run-with-idle-timer 1 nil #'foo))
>    (foo)
>
> "work" without locking up Emacs.  "Work" in the sense that the timer
> is run and increments the counter, but keyboard input is still
> accepted, and causes 1-sec break in the idle timer invocation.  What
> does NOT happen is the once-per-second invocation of the idle timer:
> as long as there's no other input, the idle timer runs much more
> frequently.  But I think this is expected, since the call to
> run-with-idle-timer above explicitly asks to be run immediately.

I think this behavior makes sense, too.

> Can you see if these changes also make js2-mode work as expected?

They do, thank you. I'll keep the workaround, though, as it reportedly 
also fixes the long-standing OS X freeze bug.

--Dmitry