Subject: Re: bug#77846: [PATCH ]31.0.50; C# dotnet compiler output incorrectly handled by compilation-mode

From: Jostein Kjønigsen <[email-masked]>
Date: Fri, 18 Apr 2025 18:57:39 +0200

> On 18 Apr 2025, at 17:14, Mattias Engdegård <[email-masked]> wrote:
> 
> +          (optional (seq "{ESC}=")) ; escape sequence sometimes found on first line of output
> 
> Please keep lines within 80 columns, and don't put actual control chars in source code; use escape sequences. You don't need the `seq`.
> Something like
> 
> +          (opt "\e=")  ; sequence sometimes found on first line of output
> 
> perhaps.
> 

I've made some changes like that, and that seems to work fine.

> As Eli remarked we'd like to see an example in compilation.txt

Done. Didn't know about this one.

> , and just as important is adding a test case in compile-tests.el.

I'll defer that slightly based on comment below.

> 
> It would also be useful to know precisely what that escape sequence is supposed to be doing. As far as I can tell, `ESC =` is the DECKPAM sequence that puts the keypad in application mode, which makes no sense at all in this context.

I'll admit to not know too much in depth stuff about escape codes and how they're used.

From trying to read the MSBuild source code, my best guess so far is that the escape-code seems to be used in an elaborate output-mode detection process:

https://github.com/dotnet/msbuild/blob/a9d68ab58eab3c25b6378a90be8060dd1429a6ef/src/Framework/NativeMethods.cs#L1588-L1642

Someone else might know more about this, or are better able to parse this code.

> 
> Perhaps it's compilation-filter-hook that really should be used to filter it out, and other sequences like it?
> 

That also seems like an appropriate solution.

Is there precedence for solution like in place already?

--
Jostein