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

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

[elpa] externals/compat c0d5634570 80/84: Simplify loading procedure


From: ELPA Syncer
Subject: [elpa] externals/compat c0d5634570 80/84: Simplify loading procedure
Date: Tue, 3 Jan 2023 08:57:40 -0500 (EST)

branch: externals/compat
commit c0d5634570d65bce07c8fb60e5b29106c379fc43
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>

    Simplify loading procedure
    
    Instead of modifying the name of the file we pass to 'load', we modify
    the order of contents in 'load-suffixes' and ensure that .el files are
    preferred over .elc files, thus preventing that the macro-expanded
    files are used, which prevents definitions form being loaded.
---
 compat-tests.el |  1 +
 compat.el       | 10 ++++------
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/compat-tests.el b/compat-tests.el
index 6cc5ed9c1a..2733a48b95 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -60,6 +60,7 @@ DEF-FN, INSTALL-FN, CHECK-FN, ATTR and TYPE."
 
 (defvar compat-testing)
 (let ((compat--generate-function #'compat--generate-testable)
+      (load-suffixes '(".el" ".elc"))
       (compat-testing t))
   (load "compat.el"))
 
diff --git a/compat.el b/compat.el
index ab490cbc98..ba2855fc39 100644
--- a/compat.el
+++ b/compat.el
@@ -47,12 +47,10 @@
   ;; the file (which is disabled by `compat--inhibit-prefixed', so
   ;; that the file can be loaded again at some later point when the
   ;; prefixed definitions are needed).
-  (dolist (vers '(24 25 26 27 28 29))
-    (unless (memq (intern (format "compat-%d" vers)) features)
-      (load (format "compat-%d%s" vers
-                    (if (bound-and-true-p compat-testing)
-                        ".el" ""))
-            nil t))))
+  (dolist (version '(24 25 26 27 28 29))
+    (let ((feature-name (format "compat-%d" version)))
+      (unless (memq (intern feature-name) features)
+        (load feature-name nil t)))))
 
 (provide 'compat)
 ;;; compat.el ends here



reply via email to

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