[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
LYNX-DEV Colors in 2.7.1 ac 36
From: |
Filip M Gieszczykiewicz |
Subject: |
LYNX-DEV Colors in 2.7.1 ac 36 |
Date: |
Mon, 21 Jul 1997 18:41:03 -0500 (CDT) |
Greetings. I found the error reporting pretty useless when twiddling
with my colors in lynx.cfg... I can't do a diff right now so here are
the changes (VERY minor). Also a bug? and some qualms...
Changes were made in file: lynx2-7-1/src/LYReadCFG.c
function exit_with_color_syntax:
-----------------chop-with-axe----------------chop-with-axe---------------------
PRIVATE void exit_with_color_syntax ARGS1(
char *, error_line)
{
unsigned int i;
fprintf (stderr, "\
Syntax Error parsing COLOR in configuration file:\n\
The line must be of the form:\n\
COLOR:INTEGER:FOREGROUND:BACKGROUND\n\
\n\
Here FOREGROUND and BACKGROUND must be one of:\n"
);
for (i = 0; i < 16; i += 4) {
fprintf(stderr, "%16s %16s %16s %16s\n",
Color_Strings[i], Color_Strings[i + 1],
Color_Strings[i + 2], Color_Strings[i + 3]);
}
fprintf (stderr, "\
Offending line:\n
%s\n",error_line);
#ifndef NOSIGHUP
(void) signal(SIGHUP, SIG_DFL);
#endif /* NOSIGHUP */
(void) signal(SIGTERM, SIG_DFL);
#ifndef VMS
(void) signal(SIGINT, SIG_DFL);
#endif /* !VMS */
#ifdef SIGTSTP
if (no_suspend)
(void) signal(SIGTSTP,SIG_DFL);
#endif /* SIGTSTP */
exit(-1);
}
-----------------chop-with-axe----------------chop-with-axe---------------------
and in function parse_color:
-----------------chop-with-axe----------------chop-with-axe---------------------
PRIVATE void parse_color ARGS1(
char *, buffer)
{
int color;
char *fg, *bg;
char parse_color_line[501];
/*
* We are expecting a line of the form:
* INTEGER:FOREGROUND:BACKGROUND
*/
if (strlen(buffer)<=500)
strcpy(parse_color_line,buffer);
else
strcpy(parse_color_line,"Color config line too long!\n");
color = atoi (buffer);
if (NULL == (fg = find_colon(buffer)))
exit_with_color_syntax(parse_color_line);
*fg++ = 0;
if (NULL == (bg = find_colon(fg)))
exit_with_color_syntax(parse_color_line);
*bg++ = 0;
#if defined(USE_SLANG)
if ((-1 == check_color(fg)) ||
(-1 == check_color(bg)))
exit_with_color_syntax(parse_color_line);
SLtt_set_color(color, NULL, fg, bg);
#else
if (lynx_chg_color(color, check_color(fg), check_color(bg)) < 0)
exit_with_color_syntax(parse_color_line);
#endif
}
#endif /* USE_COLOR_TABLE */
-----------------chop-with-axe----------------chop-with-axe---------------------
When it chokes, it will _actually_ tell you WHERE! Wow :-)
I suppose you all know that it will happily choke on a line
like:
COLOR:2:black:white # Hi!
Which is _NOT_ obvious... Comments are comments except sometimes?
Also, while I found the following table:
-----------------chop-with-axe----------------chop-with-axe---------------------
# The Integer value is interpreted as follows:
# 0 - normal
# 1 - bold
# 2 - reverse
# 3 - bold + reverse
# 4 - underline
# 5 - bold + underline
# 6 - reverse + underline
# 7 - reverse + underline + bold
-----------------chop-with-axe----------------chop-with-axe---------------------
I would REALLY like to know what "render" does lynx use each color for!
For example, #2 is the status line, #0 is normal text, etc. It would be
really nice if it was explained somewhere (where I probably missed it
even with 'grep -i'??) the above AND why certain color combinations give
wild results... [sigh]
I agree, the default colors hit me so hard (Linux console 100x37) that
I almost fell of my chair :-)
Take care.
;
; To UNSUBSCRIBE: Send a mail message to address@hidden
; with "unsubscribe lynx-dev" (without the
; quotation marks) on a line by itself.
;
- LYNX-DEV Colors in 2.7.1 ac 36,
Filip M Gieszczykiewicz <=