]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Warn on empty let bodies
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 15 Feb 2021 17:07:52 +0000 (12:07 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 15 Feb 2021 17:07:52 +0000 (12:07 -0500)
lisp/emacs-lisp/macroexp.el

index 13ff5ef2edab4949642f7c647b40840d010e39e8..0934e43e66a8c59b11683721cb2f3d40ed6939b3 100644 (file)
@@ -299,7 +299,12 @@ Assumes the caller has bound `macroexpand-all-environment'."
       (`(,(and fun (or 'let 'let*)) . ,(or `(,bindings . ,body) dontcare))
        (macroexp--cons fun
                        (macroexp--cons (macroexp--all-clauses bindings 1)
-                                       (macroexp--all-forms body)
+                                       (if (null body)
+                                           (macroexp-unprogn
+                                            (macroexp--warn-and-return
+                                             (format "Empty %s body" fun)
+                                             nil t))
+                                         (macroexp--all-forms body))
                                        (cdr form))
                        form))
       (`(,(and fun `(lambda . ,_)) . ,args)