diff options
author | Alan Mackenzie <acm@muc.de> | 2020-05-31 16:46:06 +0000 |
---|---|---|
committer | Alan Mackenzie <acm@muc.de> | 2020-05-31 16:46:06 +0000 |
commit | cc340da1fe853dc52c894d6660384e09bb9a9302 (patch) | |
tree | 74509204b14b40dc0bbf0209973cb59bccf96da5 /lisp/emacs-lisp | |
parent | 41232e679732fcd37fc56edda90035d6f98b591f (diff) | |
download | emacs-cc340da1fe853dc52c894d6660384e09bb9a9302.tar.gz emacs-cc340da1fe853dc52c894d6660384e09bb9a9302.tar.bz2 emacs-cc340da1fe853dc52c894d6660384e09bb9a9302.zip |
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.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 688f8cfa4db..5479e6536a3 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -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)) - fun))))))) + (setq fun (eval fun t))) + (if macro (push 'macro fun)) + (if (symbolp form) (fset form fun)) + fun)))))) (defun byte-compile-sexp (sexp) "Compile and return SEXP." |