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

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

[elpa] externals/compat e5ec04fea3: Eagerly expand macros in compat-entw


From: ELPA Syncer
Subject: [elpa] externals/compat e5ec04fea3: Eagerly expand macros in compat-entwine
Date: Fri, 17 Jun 2022 03:57:23 -0400 (EDT)

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

    Eagerly expand macros in compat-entwine
    
    In order for `compat--entwine-version' to be passed on to the macro
    generator functions, we cannot just bind the variable within the macro
    and forget about it.  Generating a let binding instead of a
    `progn'-block is likewise insufficient, as this would only affect the
    evaluation, not the macro-expansion.  It is therefore necessary to
    expand all macros (or at least all macros using
    `compat--generate-function', which for our intent is almost every
    case) while binding `compat--entwine-version', so that the binding is
    preserved.
    
    If this is not done, the version cannot be determined when loading
    compat.el (the main file).  To my understanding this is not fatal,
    because all this affects is that compat.elc cannot be generated, so
    the slower compat.el has to be loaded.
---
 compat.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/compat.el b/compat.el
index abe43d9204..27ec49227a 100644
--- a/compat.el
+++ b/compat.el
@@ -77,6 +77,7 @@
                       ;; compat.el is being compiled.
                       ;;   cd compat && make clean all
                       (bound-and-true-p byte-compile-current-file)))))
+             (compat--entwine-version (number-to-string version))
              defs)
         (with-temp-buffer
           (insert-file-contents file)
@@ -84,8 +85,7 @@
           (while (progn
                    (forward-comment 1)
                    (not (eobp)))
-            (let ((compat--entwine-version (format "%d.1" version))
-                  (form (read (current-buffer))))
+            (let ((form (read (current-buffer))))
               (cond
                ((memq (car-safe form)
                       '(compat-defun
@@ -97,7 +97,7 @@
                       '(declare-function
                         defvar))
                 (push form defs))))))
-        (macroexp-progn (nreverse defs)))))))
+        (macroexpand-all (macroexp-progn (nreverse defs))))))))
 
 (compat-entwine 24)
 (compat-entwine 25)



reply via email to

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