unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Augusto Stoffel <arstoffel@gmail.com>
Cc: 70137@debbugs.gnu.org
Subject: bug#70137: 30.0.50; pp-macroexpand-last-sexp buffers should turn lexical binding on
Date: Wed, 10 Apr 2024 17:39:43 -0400	[thread overview]
Message-ID: <jwvttk86gxd.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87v8504829.fsf@gmail.com> (Augusto Stoffel's message of "Tue, 02 Apr 2024 08:01:18 +0200")

> 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






  parent reply	other threads:[~2024-04-10 21:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-02  6:01 bug#70137: 30.0.50; pp-macroexpand-last-sexp buffers should turn lexical binding on Augusto Stoffel
2024-04-02 11:59 ` Eli Zaretskii
2024-04-02 20:56 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-10 21:39 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-04-14  7:42   ` Augusto Stoffel
2024-04-17 17:43     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-17 18:55       ` Augusto Stoffel
2024-04-17 21:03         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvttk86gxd.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=70137@debbugs.gnu.org \
    --cc=arstoffel@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).