[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Questions about throw-on-input
From: |
Ivan Yonchovski |
Subject: |
Questions about throw-on-input |
Date: |
Thu, 07 May 2020 10:31:23 +0300 |
User-agent: |
mu4e 1.3.7; emacs 27.0.91 |
Hi all,
I have few questions regarding throw-on-input:
1. In the following example:
(dotimes (_ 10)
(message "Length %s"
(length
(let (result)
(catch t
(let ((throw-on-input t))
(dotimes (counter 10000000)
(push (number-to-string counter) result))))
result))))
.. after I execute the following block each of the 10 computations will be
canceled after pressing C-n for example, how do I force the handling of
the command to be processed? I tried redisplay but it does not help.
2. Consider the following pieces of code:
(message "Length %s"
(length
(let (result)
(catch t
(let ((throw-on-input t))
(dotimes (counter 10000000)
(push (number-to-string counter) result))))
result)))
(run-with-idle-timer
0.0
nil
(lambda ()
(message "Length %s"
(length
(let (result)
(catch t
(let ((throw-on-input t))
(dotimes (counter 10000000)
(push (number-to-string counter) result))))
result)))))
The issue is with the second block, it seems like throw-on-input is
disregarded when used in run-with-idle-timer. Can anyone confirm if this
is a bug/desired behavior or I should use something else if I want to
run cancelable tasks in on-idle?
Thanks,
Ivan
- Questions about throw-on-input,
Ivan Yonchovski <=