unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* run-with-timer vs run-with-idle-timer
@ 2018-05-09 17:34 João Távora
  2018-05-09 18:10 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: João Távora @ 2018-05-09 17:34 UTC (permalink / raw)
  To: emacs-devel

Hi

I suspect this one has been asked before, but still, why does this
return after 1 second:

  (catch 'done
    (run-with-timer 1 nil (lambda () (throw 'done nil)))
    (while t (accept-process-output nil 0.1)))

And this never returns?

  (catch 'done
    (run-with-idle-timer 1 nil (lambda () (throw 'done nil)))
    (while t (accept-process-output nil 0.1)))

Is it because accept-process-output means emacs isn't really idle?
Because it also fails with sleep-for and sit-for...

I need this because this (while t..) spin is a common way to wait for
async conditions (in this case the async condition is flymake kicking
in).

João



^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2018-05-12 17:57 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-09 17:34 run-with-timer vs run-with-idle-timer João Távora
2018-05-09 18:10 ` Eli Zaretskii
2018-05-09 18:17 ` Eli Zaretskii
2018-05-09 18:40   ` João Távora
2018-05-09 18:59     ` Eli Zaretskii
2018-05-09 19:15       ` João Távora
2018-05-09 19:21         ` Eli Zaretskii
2018-05-09 19:34           ` João Távora
2018-05-09 20:00         ` Davis Herring
2018-05-09 20:18           ` João Távora
2018-05-10 11:46 ` Thien-Thi Nguyen
2018-05-10 12:28   ` João Távora
2018-05-10 18:50     ` Thien-Thi Nguyen
2018-05-11 10:39       ` João Távora
2018-05-11 11:05         ` João Távora
2018-05-12 17:57           ` Thien-Thi Nguyen
2018-05-12 17:37         ` Thien-Thi Nguyen

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).