Commit e7cdbc1d authored by Lars Ingebrigtsen's avatar Lars Ingebrigtsen
Browse files

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.
parent 044742bf
Pipeline #11324 failed with stages
in 1 minute and 8 seconds
......@@ -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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment