branch: externals/compat
commit fe923d8ef905dfdc1ca2a78147f5a7d28426d093
Author: Philip Kaludercic <[email protected]>
Commit: Philip Kaludercic <[email protected]>
Load compat-NM.el only if NM < emacs-major-version
As the default behaviour is just to load missing (unprefixed)
definitions, which are all compiled away if NM ≤ emacs-major-version,
there should be no functional difference. The advantage is that fewer
files have to be opened, parsed and loaded.
Suggested by Daniel Mendler in this thread:
https://lists.sr.ht/~pkal/compat-devel/%3C87cze74icg.fsf_-_%40posteo.net%3E
---
compat.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/compat.el b/compat.el
index 2cfd342057..f0e0519f5f 100644
--- a/compat.el
+++ b/compat.el
@@ -47,7 +47,8 @@
;; that the file can be loaded again at some later point when the
;; prefixed definitions are needed).
(dolist (vers '(24 25 26 27 28))
- (unless (memq (intern (format "compat-%d" vers)) features)
+ (when (and (< vers emacs-major-version)
+ (not (memq (intern (format "compat-%d" vers)) features)))
(load (format "compat-%d%s" vers
(if (bound-and-true-p compat-testing)
".el" ""))