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

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

[nongnu] elpa/with-simulated-input 26fc928f42 092/134: Work around an in


From: ELPA Syncer
Subject: [nongnu] elpa/with-simulated-input 26fc928f42 092/134: Work around an incompatibility in Emacs 24 in tests
Date: Mon, 10 Jan 2022 23:00:08 -0500 (EST)

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

    Work around an incompatibility in Emacs 24 in tests
---
 tests/test-unload.el | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/tests/test-unload.el b/tests/test-unload.el
index fd3302944e..423b1d4671 100644
--- a/tests/test-unload.el
+++ b/tests/test-unload.el
@@ -6,15 +6,19 @@
 
 (defun has-advice (symbol advice)
   (let ((advice-fun-to-find
-         (indirect-function advice))
+         ;; In Emacs 24, `indirect-function' throws an error instead
+         ;; of returning nil for void functions. We want it to return nil.
+         (ignore-errors (indirect-function advice)))
         (found nil))
-    (advice-mapc
-     (lambda (ad-fun ad-props)
-       (setq found
-             (or found
-                 (equal (indirect-function ad-fun)
-                        advice-fun-to-find))))
-     symbol)
+    (when advice-fun-to-find
+      (advice-mapc
+       (lambda (ad-fun ad-props)
+         (let ((ad-fun-def (ignore-errors (indirect-function ad-fun))))
+           (when ad-fun-def
+             (setq found
+                   (or found
+                       (equal ad-fun-def advice-fun-to-find))))))
+       symbol))
     found))
 
 (describe "The `with-simulated-input' library"



reply via email to

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