branch: elpa/with-simulated-input
commit 1012ccbec77d7d162790706c07bb23c039ccc61f
Author: Ryan C. Thompson <[email protected]>
Commit: Ryan C. Thompson <[email protected]>
Convert defadvice to advice-add
---
with-simulated-input.el | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/with-simulated-input.el b/with-simulated-input.el
index efaa0d1760..39ad4c4e79 100644
--- a/with-simulated-input.el
+++ b/with-simulated-input.el
@@ -239,16 +239,16 @@ in `progn'."
(defvar wsi-simulated-idle-time nil)
-(defadvice current-idle-time (around simulate-idle-time activate)
+(defun current-idle-time@simulate-idle-time (orig-fun &rest args)
"Return the faked value while simulating idle time.
While executing `wsi-simulate-idle-time', this advice causes the
simulated idle time to be returned instead of the real value."
(if wsi-simulated-idle-time
- (setq ad-return-value
- (when (time-less-p (seconds-to-time 0) wsi-simulated-idle-time)
- wsi-simulated-idle-time))
- ad-do-it))
+ (when (time-less-p (seconds-to-time 0) wsi-simulated-idle-time)
+ wsi-simulated-idle-time))
+ (apply orig-fun args))
+(advice-add 'current-idle-time :around 'current-idle-time@simulate-idle-time)
(cl-defun wsi-simulate-idle-time (&optional secs actually-wait)
"Run all idle timers with delay less than SECS.