rcfile: introduce the modifier "bold", for specifying bolding separately

This makes it possible to avoid the misnamed prefix "bright".  It is
misnamed because (on current terminal emulators, when the brightening
of bold is switched off) it just makes the typeface bold, not the color
brighter.  The prefix "light" will now only make the color brigther,
and the modifier "bold" will just make the typeface bold (on terminal
emulators, when the brightening of bold is switched off).

On a Linux console, which is not capable of bolding the typeface,
"bold" will brighten the color.

This fully fulfills https://savannah.gnu.org/bugs/?58503.
This commit is contained in:
Benno Schulenberg 2020-06-09 13:41:46 +02:00
parent adf7f33ea8
commit c275c5158e
2 changed files with 12 additions and 2 deletions

View File

@ -1029,6 +1029,16 @@ bool parse_combination(char *combostr, short *fg, short *bg, int *attributes)
*attributes = A_NORMAL;
if (strncmp(combostr, "bold", 4) == 0) {
*attributes = A_BOLD;
if (combostr[4] != ',') {
jot_error(N_("An attribute requires a subsequent comma"));
return FALSE;
}
combostr += 5;
comma = strchr(combostr, ',');
}
if (comma != NULL) {
*bg = color_to_short(comma + 1, &vivid, &thick);
if (vivid && thick) {
@ -1050,7 +1060,7 @@ bool parse_combination(char *combostr, short *fg, short *bg, int *attributes)
if (vivid && !thick && COLORS > 8)
*fg += 8;
else if (vivid)
*attributes = A_BOLD;
*attributes |= A_BOLD;
} else
*fg = USE_THE_DEFAULT;

View File

@ -21,7 +21,7 @@ color green "^[[:space:]]*((un)?(bind|set)|include|syntax|header|magic|comment|f
color brightmagenta "([[:space:]]|(start|end)=)".+"([[:space:]]|$)"
# Colors
color yellow "^[[:space:]]*i?color[[:space:]]*(bright|light)?(white|black|red|blue|green|yellow|magenta|cyan|normal)?(,(light)?(white|black|red|blue|green|yellow|magenta|cyan|normal))?\>"
color yellow "^[[:space:]]*i?color[[:space:]]*(bright|(bold,)?(light)?)?(white|black|red|blue|green|yellow|magenta|cyan|normal)?(,(light)?(white|black|red|blue|green|yellow|magenta|cyan|normal))?\>"
color magenta "^[[:space:]]*i?color\>" "\<(start|end)="
# Comments