[m-rev.] for review: options to control the use of color

Julien Fischer jfischer at opturion.com
Sat Apr 27 14:25:22 AEST 2024


On Sat, 27 Apr 2024, Zoltan Somogyi wrote:

> On 2024-04-26 20:44 +10:00 AEST, "Julien Fischer" <jfischer at opturion.com> wrote:
>> What you refer to as "intense" red is usually referred to as "bright"
>> red, so I suggest bright-red, bright-yellow for those versions.
>
> The attached diff, which I am committing, does this. However, we will
> need to warn users about two things.
>
> First, the names of the bright versions contain spaces, and so will
> need to be quoted on command lines.

My preference would for the bright versions to have hyphens in their
names rather than spaces.  (Or indeed why not both?)

> Second, when you ask for a named color, you will get that color
> *only* if your terminal's color setup has the color scheme
> described on the wikipedia page. For example, my xterm
> preferences are set to use a custom color scheme, so
> any request for the color names added by this diff will get
> different colors from what was asked for.

That's a given and given the tendency for command line tools to support
some form of coloured output these days, the Mercury compiler is going
to be far from the only program with this issue.

> Add support for named colors.
> 
> compiler/globals.m:
>     Recognize the names of the eight three-bit colors, and their bright
>     counterparts.

The diff looks fine.

Julien.


More information about the reviews mailing list