From: Stefan Monnier Date: Mon, 15 Feb 2021 17:07:52 +0000 (-0500) Subject: * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Warn on empty let bodies X-Git-Tag: emacs-28.0.90~3713 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d41a4ad4ae6f25c3cbc90aaaa33781821bb655c5;p=emacs.git * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Warn on empty let bodies --- diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el index 13ff5ef2eda..0934e43e66a 100644 --- a/lisp/emacs-lisp/macroexp.el +++ b/lisp/emacs-lisp/macroexp.el @@ -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)