Commit cc340da1 authored by Alan Mackenzie's avatar Alan Mackenzie
Browse files

Fix bug #41618 "(byte-compile 'foo) errors when foo is a macro."

* lisp/emacs-lisp/bytecomp.el (byte-compile): Disentangle the eval of the
final form from the pushing of 'macro onto it, doing the former first.
parent 41232e67
Pipeline #5723 passed with stage
in 62 minutes and 43 seconds
......@@ -2796,14 +2796,15 @@ If FORM is a lambda or a macro, byte-compile it as a function."
;; Expand macros.
(setq fun (byte-compile-preprocess fun))
(setq fun (byte-compile-top-level fun nil 'eval))
(if macro (push 'macro fun))
(if (symbolp form)
;; byte-compile-top-level returns an *expression* equivalent to the
;; `fun' expression, so we need to evaluate it, tho normally
;; this is not needed because the expression is just a constant
;; byte-code object, which is self-evaluating.
(fset form (eval fun t))
(setq fun (eval fun t)))
(if macro (push 'macro fun))
(if (symbolp form) (fset form fun))
(defun byte-compile-sexp (sexp)
"Compile and return SEXP."
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