[m-rev.] for review: announce color on the website

Zoltan Somogyi zoltan.somogyi at runbox.com
Mon Jun 24 13:48:42 AEST 2024


On 2024-06-24 13:24 +10:00 AEST, "Peter Wang" <novalazy at gmail.com> wrote:
> On Mon, 24 Jun 2024 12:42:11 +1000 "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
>> For review by anyone.
>> 
>> Zoltan.
> 
>> diff --git a/news/newsdb.inc b/news/newsdb.inc
>> index 6e7e6de..4649df3 100644
>> --- a/news/newsdb.inc
>> +++ b/news/newsdb.inc
>> @@ -25,6 +25,14 @@
>>  
>>  $newsdb = array(
>>  
>> +"24th June 2024" => array(
>> +"Color Diagnostics",
>> +"Mercury compilers in releases-of-the-day
>> +now use color in diagnostic messages by default.
>> +For details, see the new \"Diagnostic output\" chapter
>> +in the current rotd snapshot version of the Mercury Users' Guide.
>> +"),
> 
> Is it enabled by default?

Since yesterday's commit 0e29, yes, it is.

> I've built the mercury workspace but color
> diagnostics is not enabled without setting MERCURY_ENABLE_COLOR.

I don't know exactly what you mean by that. Building a workspace *should not* be enough
to enable color by default *for errors in that workspace*; it should be enough
only for *compilations done by the executable generated in that workspace*.

I installed a compiler yesterday that has 0e29 in it. With that compiler in my path, I can now
compile other workspaces *with* color diagnostics without any of the relevant envvars being set.

Do you by chance have NO_COLOR set? Because that would override the compiler's default.

> Will you implement the isatty check?

For the reasons I mentioned the last time this topic came up, no.
You are welcome to do so yourself, but you will have to deal with
the issues that come with it, the main one being that diagnostics generated
by mmc --make can go to BOTH a tty and a non-tty.
 
> In particular, the vim quickfix mode doesn't know anything about ANSI
> escape sequences.

This is the first time I have heard of that mode, though I do know that
vim in general does not handle those escape sequences.

> Anyone using quickfix would need to explicitly disable
> color.

Would it take more effort than setting the compiler not to "mmc",
but to "mmc --no-color-diagnostics"?

Whether the answer is yes or no, if you want to make life easier
for people using quickfix, you should consider adding a new section
to the new Diagnostic output chapter of the users' guide.
If you do, I'll add a prequel describing how to use the "error" program
in extras.

Zoltan.


More information about the reviews mailing list