Subject: bug#45443: 28.0.50; Can't find definition of compilation--message->loc

From: Daniel Martín <[email-masked]>
Date: Sun, 27 Dec 2020 20:28:57 +0100

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

>>
>> Why do we need to expand macros? isn't it enough to find the defstruct
>> itself, by looking for a partial match?
>
> I haven't look at the patch, but I think the approach of macro expanding
> is more general as should be able to track any function definition that
> is synthesized by any macro.
>

Yes, my patch tried a more general approach, which would not only find
function definitions, but also defvars like the hooks that are
synthesized by define-major-mode, for example.

There's some opportunities to do less work, though.  For example, I
think it does not make sense to expand defuns because those were handled
in a previous step.  I think that'd reduce the search space
significantly.

Another possible approach for this problem is to search textually for
just the things that we're typically interested in (like, cl-defstruct
or define-derived-mode), and expand only those to see if they synthesize
the symbol we are looking for.  It will be a less general solution, but
it will be faster.  We may add more cases in the future, if needed.

Thoughts?