Subject: Re: bug#14422: 24.3; Eager Macro Expansion

From: Lars Ingebrigtsen <[email-masked]>
Date: Tue, 25 Aug 2020 13:05:43 +0200

Stefan Monnier <[email-masked]> writes:

>> The behavior is still different in a few other cases (where eager macro
>> expansion is not performed, typically M-C-x and things like that), but
>> I hope to reduce/eliminate them at some point.
>
> It just occurred to me that the patch below which I just installed
> covers several of those cases.
>
>         Stefan
>
> --- lisp/emacs-lisp/lisp-mode.el	2013-05-29 14:14:16 +0000
> +++ lisp/emacs-lisp/lisp-mode.el	2013-06-03 14:23:31 +0000
> @@ -809,6 +809,7 @@
>  (defun eval-sexp-add-defvars (exp &optional pos)
>    "Prepend EXP with all the `defvar's that precede it in the buffer.
>  POS specifies the starting position where EXP was found and defaults to point."
> +  (setq exp (macroexpand-all exp))      ;Eager macro-expansion.
>    (if (not lexical-binding)
>        exp
>      (save-excursion

It's unclear whether this fixes the reported bug?  I tried the final
test case, and I didn't get any errors (but I'm not sure I'm testing
that the right way).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no