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

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

[elpa] externals/compat 5607bec3c2 07/10: Do not modify load-suffixes du


From: ELPA Syncer
Subject: [elpa] externals/compat 5607bec3c2 07/10: Do not modify load-suffixes during loading
Date: Sun, 17 Jul 2022 17:57:25 -0400 (EDT)

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

    Do not modify load-suffixes during loading
    
    It appears that even this is too risky, and can cause issues recursive
    loading (from what I understand loading the non-byte compiled
    jka-compr.el causes this issue).  Instead we will check if
    `compat-testing' is bound and true, in which case we explicitly load
    the .el file, and otherwise keep the file without a specific suffix.
---
 compat.el | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/compat.el b/compat.el
index b0996f272e..b1e1261ce5 100644
--- a/compat.el
+++ b/compat.el
@@ -48,21 +48,18 @@
 ;; and do nothing when loading each sub-feature manually.
 
 (defvar compat--inhibit-prefixed)
-(let ((compat--inhibit-prefixed (not (bound-and-true-p compat-testing)))
-      (load-suffixes
-       (if (bound-and-true-p compat-testing)
-           (cons ".el" (remove ".el" load-suffixes))
-         load-suffixes)))
+(let ((compat--inhibit-prefixed (not (bound-and-true-p compat-testing))))
   ;; Instead of using `require', we manually check `features' and call
   ;; `load' to avoid the issue of not using `provide' at the end of
   ;; 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).
-  (unless (memq 'compat-24 features) (load "compat-24"))
-  (unless (memq 'compat-25 features) (load "compat-25"))
-  (unless (memq 'compat-26 features) (load "compat-26"))
-  (unless (memq 'compat-27 features) (load "compat-27"))
-  (unless (memq 'compat-28 features) (load "compat-28")))
+  (dolist (vers '(24 25 26 27 28))
+    (unless (memq (intern (format "compat-%d" vers)) features)
+      (load (format "compat-%d%s" vers
+                    (if (bound-and-true-p compat-testing)
+                        ".el" ""))
+            nil t))))
 
 (provide 'compat)
 ;;; compat.el ends here



reply via email to

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