aboutsummaryrefslogtreecommitdiff
path: root/compat.el
diff options
context:
space:
mode:
authorPhilip Kaludercic <philipk@posteo.net>2022-12-15 23:03:31 +0100
committerPhilip Kaludercic <philipk@posteo.net>2022-12-15 23:03:31 +0100
commitc0d5634570d65bce07c8fb60e5b29106c379fc43 (patch)
tree29ac0ba88baf7af07d8e24da4f661514d40f9fc8 /compat.el
parent043e3d71b5c876b028a39afd6796a2aa9b694b65 (diff)
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.
Diffstat (limited to 'compat.el')
-rw-r--r--compat.el10
1 files changed, 4 insertions, 6 deletions
diff --git a/compat.el b/compat.el
index ab490cb..ba2855f 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