diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2021-07-06 16:43:49 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2021-07-06 16:43:49 +0200 |
commit | 43fba076c99cb8e62236f636bfc036068a63c166 (patch) | |
tree | 9e0ee066391bd4399a6625b798afb4d2f9e170d7 /lisp/emacs-lisp/macroexp.el | |
parent | 748bf7b93edcfd1707fa3f593a330979e280eb49 (diff) | |
download | emacs-43fba076c99cb8e62236f636bfc036068a63c166.tar.gz emacs-43fba076c99cb8e62236f636bfc036068a63c166.tar.bz2 emacs-43fba076c99cb8e62236f636bfc036068a63c166.zip |
Allow inhibiting warnings about unused variables and empty bodies
* lisp/emacs-lisp/cconv.el (cconv--warn-unused-msg): Allow
inhibiting warnings about unbound variables (bug#26486).
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Allow
inhibiting warnings about empty bodies.
Diffstat (limited to 'lisp/emacs-lisp/macroexp.el')
-rw-r--r-- | lisp/emacs-lisp/macroexp.el | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el index df864464b77..11387df2147 100644 --- a/lisp/emacs-lisp/macroexp.el +++ b/lisp/emacs-lisp/macroexp.el @@ -319,14 +319,16 @@ Assumes the caller has bound `macroexpand-all-environment'." (`(,(and fun (or 'let 'let*)) . ,(or `(,bindings . ,body) pcase--dontcare)) (macroexp--cons fun - (macroexp--cons (macroexp--all-clauses bindings 1) - (if (null body) - (macroexp-unprogn - (macroexp-warn-and-return - (format "Empty %s body" fun) - nil t)) - (macroexp--all-forms body)) - (cdr form)) + (macroexp--cons + (macroexp--all-clauses bindings 1) + (if (null body) + (macroexp-unprogn + (macroexp-warn-and-return + (and (byte-compile-warning-enabled-p t) + (format "Empty %s body" fun)) + nil t)) + (macroexp--all-forms body)) + (cdr form)) form)) (`(,(and fun `(lambda . ,_)) . ,args) ;; Embedded lambda in function position. |