summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2021-07-06 22:01:55 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2021-07-06 22:01:55 +0200
commite7cdbc1d1d46b365ec3a7f5eaa0c14f60119014e (patch)
tree965d1c87dada195e862915c82820a48a2ce1cbe4 /lisp/emacs-lisp
parent044742bfe8c7c22e303242c40e16fbe9e564727a (diff)
downloademacs-e7cdbc1d1d46b365ec3a7f5eaa0c14f60119014e.tar.gz
emacs-e7cdbc1d1d46b365ec3a7f5eaa0c14f60119014e.tar.bz2
emacs-e7cdbc1d1d46b365ec3a7f5eaa0c14f60119014e.zip
Make previous empty-body warning disabling more robust
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all): `byte-compile-warning-enabled-p' may not be defined here.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/macroexp.el26
1 files changed, 14 insertions, 12 deletions
diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el
index 11387df2147..f4bab9c3456 100644
--- a/lisp/emacs-lisp/macroexp.el
+++ b/lisp/emacs-lisp/macroexp.el
@@ -318,18 +318,20 @@ Assumes the caller has bound `macroexpand-all-environment'."
(`(,(or 'function 'quote) . ,_) form)
(`(,(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
- (and (byte-compile-warning-enabled-p t)
- (format "Empty %s body" fun))
- nil t))
- (macroexp--all-forms body))
- (cdr form))
- form))
+ (macroexp--cons
+ fun
+ (macroexp--cons
+ (macroexp--all-clauses bindings 1)
+ (if (null body)
+ (macroexp-unprogn
+ (macroexp-warn-and-return
+ (and (or (not (fboundp 'byte-compile-warning-enabled-p))
+ (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.
;; If the byte-optimizer is loaded, try to unfold this,