emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/with-simulated-input 1012ccbec7 033/134: Convert defadvice


From: ELPA Syncer
Subject: [nongnu] elpa/with-simulated-input 1012ccbec7 033/134: Convert defadvice to advice-add
Date: Mon, 10 Jan 2022 23:00:02 -0500 (EST)

branch: elpa/with-simulated-input
commit 1012ccbec77d7d162790706c07bb23c039ccc61f
Author: Ryan C. Thompson <rct@thompsonclan.org>
Commit: Ryan C. Thompson <rct@thompsonclan.org>

    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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]