Subject: Re: bug#74018: 31.0.50; Issue with define-peg-ruleset?

From: Andrea Corallo <[email-masked]>
Date: Fri, 25 Oct 2024 17:01:18 -0400

Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <[email-masked]> writes:

> Package: Emacs
> Version: 31.0.50
>
>
> Augusto pointed out a bug in `peg.el` when you have code like:
>
>     (define-peg-ruleset myrules
>       (sign  () (or "+" "-" ""))
>       (digit () [0-9])
>       (nat   () digit (* digit))
>       (int   () sign digit (* digit))
>       (float () int "." nat))
>
>     (with-peg-rules
>         (myrules
>          (complex float "+i" float))
>       (peg-parse nat "," nat "," complex) )
>
> where the macroexpanded code is wrong and leads to errors like:
>
>     Debugger entered--Lisp error: (void-function peg-rule\ nat)
>
> I was about to install the bugfix below to `master` but noticed that it
> probably belongs to `emacs-30` instead since the bug makes
> `define-peg-ruleset` basically unusable and PEG is new in Emacs-30.
>
> Any objection?

No objections on my side.

Thanks

  Andrea