[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master e7cdbc1: Make previous empty-body warning disabling more robust
From: |
Lars Ingebrigtsen |
Subject: |
master e7cdbc1: Make previous empty-body warning disabling more robust |
Date: |
Tue, 6 Jul 2021 16:02:08 -0400 (EDT) |
branch: master
commit e7cdbc1d1d46b365ec3a7f5eaa0c14f60119014e
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
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.
---
lisp/emacs-lisp/macroexp.el | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el
index 11387df..f4bab9c 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,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master e7cdbc1: Make previous empty-body warning disabling more robust,
Lars Ingebrigtsen <=