[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A question regarding sit-for (and while-no-input)
From: |
Stefan Monnier |
Subject: |
Re: A question regarding sit-for (and while-no-input) |
Date: |
Thu, 06 Sep 2018 08:33:32 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
> A quick followup to my question. I did some more tests and it seems an
> using unwind-protect fixes the issue.
>
> (unwind-protect
> (while (sit-for 30))
> (setq cancelled t)
> ...)
Ha, that's exactly what I was about to suggest.
> I don't understand the need for the "unwind-protect" and my question
> stands. Is the sit-for call silently quitting or what? I don't see any
> "Quit" in my *Messages* buffer and I'm not pressing C-g at any moment.
Maybe the code is sometimes run within a while-no-input?
Also the sit-for could exit non-locally if some other code
(timer/processfilter) does a `throw`.
Stefan