GNU bug report logs -
#70137
30.0.50; pp-macroexpand-last-sexp buffers should turn lexical binding on
Previous Next
Reported by: Augusto Stoffel <arstoffel <at> gmail.com>
Date: Tue, 2 Apr 2024 06:02:02 UTC
Severity: normal
Found in version 30.0.50
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> If you call pp-macroexpand-last-sexp in a buffer with lexical binding,
> the resulting *Pp Macroexpand Output* buffer has lexical binding turned off.
>
> The problem with this is that if you now go the *Pp Macroexpand Output*
> buffer and call pp-macroexpand-last-sexp again, this second macro
> expansion step may not reflect what would happen in the original buffer;
> I don't recall an example, but some macros expand differently in the two
> variable scoping modes.
Indeed. `dolist` and `dotimes` were such examples (tho nowadays they
return the same result). Most other examples I can think of signal
an error when used without lexical binding. There are a few more subtle
examples where the macro tests `macroexp--dynamic-variable-p`.
Do you happen to have a patch to propagate the value of
`lexical-binding` to the new buffer?
Stefan
This bug report was last modified 1 year and 36 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.