emacs-diffs
[Top][All Lists]
Advanced

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

master 80cf13a3d2: Make "eager macro-expansion" warning into an error


From: Lars Ingebrigtsen
Subject: master 80cf13a3d2: Make "eager macro-expansion" warning into an error
Date: Thu, 30 Jun 2022 07:19:08 -0400 (EDT)

branch: master
commit 80cf13a3d27d8a967feafeec32fd130529635592
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Make "eager macro-expansion" warning into an error
    
    * doc/lispref/loading.texi (How Programs Do Loading): Update
    documentation.
    
    * lisp/emacs-lisp/macroexp.el:
    (internal-macroexpand-for-load): We've been warning about eager
    macro expansion for many years, so finally change that into an
    error (bug#18154).
---
 doc/lispref/loading.texi    | 5 ++---
 etc/NEWS                    | 3 +++
 lisp/emacs-lisp/macroexp.el | 6 +++---
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi
index 8a2bb5fa2d..00a1fe05fd 100644
--- a/doc/lispref/loading.texi
+++ b/doc/lispref/loading.texi
@@ -149,10 +149,9 @@ up the execution of uncompiled code.  Sometimes, this 
macro expansion
 cannot be done, owing to a cyclic dependency.  In the simplest
 example of this, the file you are loading refers to a macro defined
 in another file, and that file in turn requires the file you are
-loading.  This is generally harmless.  Emacs prints a warning
+loading.  Emacs will issue an error about
 (@samp{Eager macro-expansion skipped due to cycle@dots{}})
-giving details of the problem, but it still loads the file, just
-leaving the macro unexpanded for now.  You may wish to restructure
+giving details of the problem.  You have to restructure
 your code so that this does not happen.  Loading a compiled file does
 not cause macroexpansion, because this should already have happened
 during compilation.  @xref{Compiling Macros}.
diff --git a/etc/NEWS b/etc/NEWS
index 1d56547d0d..ad0acd674e 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -159,6 +159,9 @@ of 'user-emacs-directory'.
 
 * Incompatible changes in Emacs 29.1
 
++++
+** Warning about "eager macro-expansion failure" is changed into an error.
+
 ---
 ** Previously, the X reverseVideo value at startup was heeded for all frames.
 This meant that if you had a reverseVideo resource on the initial
diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el
index bae303c213..0fb4cf680a 100644
--- a/lisp/emacs-lisp/macroexp.el
+++ b/lisp/emacs-lisp/macroexp.el
@@ -796,8 +796,8 @@ test of free variables in the following ways:
         (if (eq (car-safe (car bt)) 'macroexpand-all) (setq bt (cdr bt)))
         (if macroexp--debug-eager
             (debug 'eager-macroexp-cycle)
-          (message "Warning: Eager macro-expansion skipped due to cycle:\n  %s"
-                   (mapconcat #'prin1-to-string (nreverse bt) " => ")))
+          (error "Warning: Eager macro-expansion skipped due to cycle:\n  %s"
+                 (mapconcat #'prin1-to-string (nreverse bt) " => ")))
         (push 'skip macroexp--pending-eager-loads)
         form))
      (t
@@ -811,7 +811,7 @@ test of free variables in the following ways:
          ;; Hopefully this shouldn't happen thanks to the cycle detection,
          ;; but in case it does happen, let's catch the error and give the
          ;; code a chance to macro-expand later.
-         (message "Eager macro-expansion failure: %S" err)
+         (error "Eager macro-expansion failure: %S" err)
          form))))))
 
 ;; ¡¡¡ Big Ugly Hack !!!



reply via email to

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