Subject: Re: bug#53526: 29.0.50; macroexp-warn-and-return API change

From: Stefan Monnier <[email-masked]>
Date: Sun, 30 Jan 2022 12:01:46 -0500

>> No, its name was changed from "macroexp--" to "macroexp-" in Emacs-28,
>> specifically to make available for third party packages.  It was
>> announced in etc/NEWS, for example.
> Are you aware of it being used anywhere else but lisp/emacs-lisp?

Yes and no: there's a use of `macroexp--warn-and-return` in `peg.el`
(in GNU ELPA).  This should be updated to use `macroexp-warn-and-return`
when Emacs-28 is released.

But changing the API this way will discourage its use outside of Emacs
since it's be a pain to write code that deals with such changes (short
of imposing Emacs-29 as the minimum supported version).

>> Still, the current setup is really ugly: that var belongs in
>> `bytecomp.el`.
> Well, I suppose it could be defined in bytecomp.el and just declared in
> macroexp.el.

That's all we need.

> It's not going to get used before it's been initialised in
> bytecomp.el.

If that's the case, it's even better.

>> I'd put a double hyphen there simply because it's not something that we
>> want to expose as an official API.  Just because the bytecompiler's
>> macroexpansion phase is implemented in a separate file doesn't justify
>> making the var public.
> OK, we can mange that.

Thanks.

> I suspect the difficulty in understanding this facility will have
> strongly dissuaded any external hackers from attempting to use it.

Could be.
I suspect it's more a lack of exposure and the fact that most macros are
quick hacks that don't bother to perform much checking.

But it's definitely a facility that's useful for libraries that mostly
define a DSL via macros, like `peg.el` and `bindat.el`.

        Stefan