[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/compat 5d4fdf41db 01/10: Merge byte compilation output
From: |
ELPA Syncer |
Subject: |
[elpa] externals/compat 5d4fdf41db 01/10: Merge byte compilation output into a single file |
Date: |
Mon, 28 Feb 2022 03:57:32 -0500 (EST) |
branch: externals/compat
commit 5d4fdf41db3225398e05573cbc916476976da392
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>
Merge byte compilation output into a single file
---
compat.el | 44 ++++++++++++++++++++++++++++++++++++++------
1 file changed, 38 insertions(+), 6 deletions(-)
diff --git a/compat.el b/compat.el
index d3f2e50a71..2a71f68902 100644
--- a/compat.el
+++ b/compat.el
@@ -140,12 +140,44 @@ advice."
(not (eq (cdr (compat-func-arity func t)) n))
(void-function t))))
-;; Load the actual compatibility definitions:
-(require 'compat-24.4)
-(require 'compat-25.1)
-(require 'compat-26.1)
-(require 'compat-27.1)
-(require 'compat-28.1)
+;; To accelerate the loading process, we insert the contents of
+;; compat-N.M.el directly into the compat.elc.
+(eval-and-compile
+ (defmacro compat-insert (version)
+ (if (boundp 'compat-testing)
+ (load (format "compat-%s.el" version))
+ (let* ((file (expand-file-name
+ (format "compat-%s.el" version)
+ (file-name-directory
+ (or (and (boundp 'byte-compile-current-file)
byte-compile-current-file)
+ load-file-name
+ buffer-file-name))))
+ (byte-compile-current-file file)
+ defs)
+ (unless (file-exists-p file)
+ (error "Cannot load %S" file))
+ (let ((load-file-name file))
+ (with-temp-buffer
+ (insert-file-contents file)
+ (emacs-lisp-mode)
+ (while (progn
+ (forward-comment 1)
+ (not (eobp)))
+ (let ((sexp (read (current-buffer))))
+ (push (if (or (eq (car-safe sexp) 'compat-defun)
+ (eq (car-safe sexp) 'compat-defmacro)
+ (eq (car-safe sexp) 'compat-advise)
+ (eq (car-safe sexp) 'compat-defvar))
+ (macroexpand-all sexp)
+ sexp)
+ defs)))
+ (cons 'progn (nreverse defs))))))))
+
+(compat-insert "24.4")
+(compat-insert "25.1")
+(compat-insert "26.1")
+(compat-insert "27.1")
+(compat-insert "28.1")
;;;; Etcetera
- [elpa] externals/compat updated (ab08067970 -> 8792ab17be), ELPA Syncer, 2022/02/28
- [elpa] externals/compat 0faf5f469c 03/10: Merge branch 'master' into testing, ELPA Syncer, 2022/02/28
- [elpa] externals/compat 5d4fdf41db 01/10: Merge byte compilation output into a single file,
ELPA Syncer <=
- [elpa] externals/compat ccc8b1fd36 02/10: Compress and merge the compiled result of compat.elc, ELPA Syncer, 2022/02/28
- [elpa] externals/compat 50b26ffdf2 07/10: Install nadvice in compat-tests before loading compat, ELPA Syncer, 2022/02/28
- [elpa] externals/compat 28f57d52a0 06/10: Fix copyright for compat-font-lock.el, ELPA Syncer, 2022/02/28
- [elpa] externals/compat a793b0b6e9 05/10: Extract font-locking into compat-font-lock.el, ELPA Syncer, 2022/02/28
- [elpa] externals/compat 4d3d0bf680 08/10: Fix duplicate definition testing checking, ELPA Syncer, 2022/02/28
- [elpa] externals/compat 8792ab17be 10/10: Merge branch 'testing', ELPA Syncer, 2022/02/28
- [elpa] externals/compat c91756bad6 04/10: Have a prefixed minimal compatibility expand to nil, ELPA Syncer, 2022/02/28
- [elpa] externals/compat 164672060f 09/10: Only generate verbose expansions when testing, ELPA Syncer, 2022/02/28