Subject: bug#65344: 28.2; Unable to Edebug cl-flet form which uses argument destructuring

From: Gerd Möllmann <[email-masked]>
Date: Wed, 23 Aug 2023 16:08:24 +0200

Gerd Möllmann <[email-masked]> writes:

> Mattias Engdegård <[email-masked]> writes:
>
>>> Gerd, edebug-tests fail on master after your changes (cc0f546825). Would you do something about that?
>>
>> And cl-macs-tests.
>
> Strange stuff, I guess I'll need some time to understand what is going
> on.  As a temporary measure I've reverted my last commit, the reversing
> of the &defines.

Maybe it's not so temporary after all.

The problem seems to be the attempt to first match the spec

  (&define [&name symbolp "@cl-flet@"]
           [&name [] gensym] ;Make it unique!
           def-form)])

with (for example)

  (fn ((x y)) ...) or
  (fn (&rest x) ...)

Edebug then matches def-form with ((x y)) or (&rest x), and it finds it
doesn't match.  I would have expected that this leads to backtracking
and trying the second alternative of the &or, but that's not happening.

So, at the moment we're kinda stuck with the situation that local
functions that look like local-functions with empty body, like

  (cl-flet ((fn (...)))
    ...)

are not instrumented like the cl-flet extension case.  That's not a
catastrphy, I guess.