Subject: bug#62560: 28.2; compile-mode misidentifies compiler output

From: Tom Tromey <[email-masked]>
Date: Fri, 31 Mar 2023 09:01:42 -0600

>>>>> "Eli" == Eli Zaretskii <[email-masked]> writes:

Eli> Any idea how to accomplish that, given that GCC emits unformatted and
Eli> unstructured text?

Maybe ignore lines starting with whitespace and then "|"?

Eli> We could complicate the heck out of our regexps,
Eli> but theoretically a compiler could emit an error message that quotes
Eli> text that looks exactly as warning/error message, and what do we do
Eli> then?

Yeah... keep on patching I suppose.

Eli> Are there any developments in compilers to produce structured text,
Eli> like JSON or XML?

In

(info "(gcc) Diagnostic Message Formatting Options")

I see:

'-fdiagnostics-format=FORMAT'
     Select a different format for printing diagnostics.  FORMAT is
     'text' or 'json'.  The default is 'text'.

I guess it could be made to work, though to be really useful I think
Emacs would have to reformat this before inserting in the compilation
buffer; but also it doesn't really solve the problem because while gcc
does this, many other tools run by make do not.

Tom