[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] [PATCH] bright colors without bold

From: Benno Schulenberg
Subject: Re: [Nano-devel] [PATCH] bright colors without bold
Date: Wed, 31 Jan 2018 21:01:54 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

Op 30-01-18 om 02:48 schreef Brand Huntsman:
Attached patch changes bright to only mean bright.

Sigh.  Please get rid of the italics and reverse and whatever else is
not needed to separate bold from bright.

The bold attribute will still brighten named colors, that is just how A_BOLD works.


The biggest problem is if an external syntax gets updated before nano. The old
nano will see "bold,*", throw an error and ignore the regex.

That's fine.  There is no real need to use "bold".  Only for short keywords
it is useful: it makes those more visible.  If users wanted to use bold for
most bright colors, we might as well not bother to separate bold and bright.

With the brightisnotbold toggle, external syntaxes could wait a year before
switching to bold attribute and continue to work with both old and new nano.
At some point, bright could be converted to new behavior and brightisnotbold
could be ignored for a year before removing it.

Too confusing.

A few comments on the first patch.

+/* Get number of colors supported by terminal and initialize lookup tables. */
+void extended_color_init(void)

What lookup tables?

+   if (!has_colors())
+       nr_term_colors = 0;
+   if (tgetent(NULL, getenv("TERM")) != 1) {
+       nr_term_colors = 0;
+       return;
+   }
+   nr_term_colors = tgetnum("Co");

I would write the above as:

    if (tgetent(NULL, getenv("TERM")) == 1)
        nr_term_colors = tgetnum("Co");
        nr_term_colors = 0;


reply via email to

[Prev in Thread] Current Thread [Next in Thread]