[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/with-simulated-input e7e8829eee 020/134: Make SECS arg to
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/with-simulated-input e7e8829eee 020/134: Make SECS arg to wsi-simulated-idle-time optional |
Date: |
Mon, 10 Jan 2022 23:00:00 -0500 (EST) |
branch: elpa/with-simulated-input
commit e7e8829eee4f6848a385a46a4d9d91cbc0c5c4d9
Author: Ryan C. Thompson <rct@thompsonclan.org>
Commit: Ryan C. Thompson <rct@thompsonclan.org>
Make SECS arg to wsi-simulated-idle-time optional
---
with-simulated-input.el | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/with-simulated-input.el b/with-simulated-input.el
index 290d2f45ee..e4787cb936 100644
--- a/with-simulated-input.el
+++ b/with-simulated-input.el
@@ -221,7 +221,7 @@ simulated idle time to be returned instead of the real
value."
wsi-simulated-idle-time))
ad-do-it))
-(cl-defun wsi-simulate-idle-time (secs &optional actually-wait)
+(cl-defun wsi-simulate-idle-time (&optional secs actually-wait)
"Run all idle timers with delay less than SECS.
This simulates resetting the idle time to zero and then being
@@ -229,10 +229,24 @@ idle for SECS seconds. If ACTUALLY-WAIT is non-nil, this
function
will also wait for the specified amount of time before running
each timers.
+If SECS is nil, simulate enough idle time to run each timer in
+`timer-idle-list' at least once. (It's possible that some timers
+will be run more than once, since each timer could potentially
+add new timers to the list.)
+
While each timer is running, `current-idle-time' will be
-overridden to return the current simulated idle time."
+overridden to return the current simulated idle time.
+
+This function does not run any timers in `timer-list', even
+though they would run during real idle time."
(interactive
"nSeconds of idle time: \nP")
+ ;; SECS defaults to the maximum idle time of any currently active
+ ;; timer.
+ (unless secs
+ (setq secs
+ (cl-loop for timer in timer-idle-list
+ maximize (float-time (timer--time timer)))))
(cl-loop
with already-run-timers = nil
with stop-time = (seconds-to-time secs)
- [nongnu] elpa/with-simulated-input 00209c2be3 128/134: Test on 27.2 instead of 27.1, (continued)
- [nongnu] elpa/with-simulated-input 00209c2be3 128/134: Test on 27.2 instead of 27.1, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 1006e93000 125/134: Add more tests to improve coverage, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 9c160b2d81 106/134: Add warnings for quoted list KEYS and nil/constant BODY, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 4eedb0eee8 126/134: Use an alternate method to disable eager macro-expansion for testing, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 9d082a372a 113/134: Be more selective about which file changes trigger a CI run, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 681397b90d 130/134: Also test variables containing characters, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 9ecf7c3f84 107/134: Improve code for detecting warnings in tests, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input ddd7bd71b1 011/134: Add "wsi-simulate-idle-time" and tests for it, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 662055c0a5 029/134: Handle non-lexical contexts as well as lexical, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 7f37451dcf 019/134: Use closures instead of quoted expressions, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input e7e8829eee 020/134: Make SECS arg to wsi-simulated-idle-time optional,
ELPA Syncer <=
- [nongnu] elpa/with-simulated-input 47aa40dbe1 021/134: Handle the case where SECS exactly equals a timer's time, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 5ce98adda7 022/134: Add test for SECS = nil and for repeated idle simulations, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input e860a39bba 024/134: Version 2.1, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input c57ba13c17 043/134: Disable Travis testing emacs snapshot because it hangs, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 9fc83ac95d 047/134: Put spies in before-each form, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 2917358875 054/134: Minor CI tweaks, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 7bbe0ff680 056/134: Make sure buttercup and undercover are loadable in "eldev emacs", ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 311c142650 059/134: Add comments explaining why tests are run twice, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 09d6f80ddc 065/134: Add an `edebug' spec, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 14f3d86cb3 071/134: Fix tests, ELPA Syncer, 2022/01/10