aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compat-tests.el7
-rw-r--r--compat.el3
2 files changed, 9 insertions, 1 deletions
diff --git a/compat-tests.el b/compat-tests.el
index 5c76084..79dcc85 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -45,6 +45,13 @@
(defmacro should-equal (a b)
`(should (equal ,a ,b)))
+(ert-deftest compat-loaded-features ()
+ (let ((version 0))
+ (while (< version 30)
+ (should-equal (> version emacs-major-version)
+ (featurep (intern (format "compat-%s" version))))
+ (setq version (1+ version)))))
+
(ert-deftest compat-function ()
(let ((sym (compat-function plist-put)) list)
(should sym)
diff --git a/compat.el b/compat.el
index 7e37e14..269b947 100644
--- a/compat.el
+++ b/compat.el
@@ -42,7 +42,8 @@
;;; Code:
-(when (< emacs-major-version 29) (require 'compat-29))
+(when (eval-when-compile (< emacs-major-version 29))
+ (require 'compat-29))
(defmacro compat-function (fun)
"Return compatibility function symbol for FUN.