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

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

[nongnu] elpa/with-simulated-input e7a7a6c39d 109/134: Don't use "define


From: ELPA Syncer
Subject: [nongnu] elpa/with-simulated-input e7a7a6c39d 109/134: Don't use "define-advice" in tests
Date: Mon, 10 Jan 2022 23:00:10 -0500 (EST)

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

    Don't use "define-advice" in tests
    
    This macro doesn't exist in Emacs 24.
---
 tests/test-with-simulated-input.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/test-with-simulated-input.el 
b/tests/test-with-simulated-input.el
index 2e689e0a42..685273cdc5 100644
--- a/tests/test-with-simulated-input.el
+++ b/tests/test-with-simulated-input.el
@@ -45,8 +45,11 @@ put this outside any relevant `let' forms."
   "Count of warnings that have been displayed.")
 (defsubst reset-warnings-count (&optional n)
   (setq warnings-displayed-count (or n 0)))
-(define-advice display-warning (:before (&rest _args) count-calls)
+
+;; No `define-advice' on Emacs 24.
+(defun display-warning@count-calls (&rest _args)
   (cl-incf warnings-displayed-count))
+(advice-add 'display-warning :before #'display-warning@count-calls)
 
 (defmacro expect-warning (&rest body)
   "Evaluate BODY and verify that it produces a warning.



reply via email to

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