Subject: Re: bug#25987: 25.2; support gcc fixit notes

From: Eli Zaretskii <[email-masked]>
Date: Tue, 13 Oct 2020 17:37:54 +0300

> From: David Malcolm <[email-masked]>
> Cc: [email-masked]
> Date: Mon, 12 Oct 2020 18:27:29 -0400
> 
> I like how -fdiagnostics-parseable-fixits adds extra lines of output,
> with a prefix that's ought to be easy to detect.

Yes, I think that's preferable, indeed.

> BTW, does Emacs set anything in the environment that GCC could detect?

Yes, Emacs sets INSIDE_EMACS when it runs a sub-process.

> Does Emacs have an automated test suite that could test this feature?

Yes, see the tests in the test/ subdirectory of the Emacs tree.

> Another complication to consider: the locations in a fix-it hint refer
> to the original source file, before any changes are made.  If the user
> interface supports the user e.g. clicking on fix-it hints and
> selectively apply them one by one, then after each fix-it hint is
> applied, all locations after that point potentially need to be "fixed
> up" somehow, to reflect the changes to the buffer.

That could be handled automatically by defining a marker at each
hint's location, then they will move as text is edited.