Subject: Re: bug#65513: 29.1; Ansi colors do not work in compilation buffers

From: Jim Porter <[email-masked]>
Date: Fri, 25 Aug 2023 09:09:24 -0700

On 8/24/2023 11:29 PM, Eli Zaretskii wrote:
>> From: Daniel Zurawski <[email-masked]>
>> Date: Thu, 24 Aug 2023 14:30:31 -0600
>>
>> Colors arent rendered in compiation buffers, the ansi color code text is displayed.
>> I have resolved the issue but adding these lines to my init.el
>>
>> (require 'ansi-color)
>> (add-hook 'compilation-filter-hook 'ansi-color-compilation-filter)
> 
> AFAIU, this is exactly what you need to do if you want the ANSI color
> sequences to be supported in compilation buffers.  Emacs currently
> supports that automatically only in Grep buffers (set
> grep-highlight-matches to t to activate).

Yeah, I think this isn't a bug: since compilation mode adds its own 
highlighting to buttonize errors and such, it could be confusing if you 
also saw the ANSI colors in the same block of text. The hook mentioned 
above is the way for users to opt into this potentially-confusing behavior.

For Grep buffers, I think that option is a bit different: to get the 
matched region from Grep output, you need to examine the ANSI sequences 
in the output. The Emacs Grep code then uses that to add our *own* 
fontification, and then we strip out the ANSI sequences (see 'grep-filter').