On Wed, 15 Mar 2000, Henry Nelson wrote:

> > doesn't exist with ncurses, I ask again: Could any of you, please,
> > correct the problem with lynx compiled with slang that shows colors 4 and
> > 5 in color _and_ underlined instead of just in color?
> 
> I think we need to praise Tom for his tireless efforts, and grit our teeth
> and forgive him for his understandable bias towards ncurses.

I do. I always compile two versions of lynx, one with slang and the other
with ncurses. I compile every new version/patch of ncurses and report any
problem to Thomas. I have even subscribed to the bug-ncurses mailing lists
recently.

> Slang is not really his problem; we should thank him just for letting
> support for it stay.

The problem here is not slang but lynx. Thomas often uses the excuse that
it's "hardcoded into slang" for not trying to correct a problem in the
lynx/slang version.

> That said, I, too, have pretty much dropped ncurses in favor of slang
> because the latter is so much easier to compile and maintain on limited
> resource machines and especially within the confines of a single account.
> My lynx has mostly and probably forever will be compiled against the slang
> library.

I also like slang better. It's lighter and faster than ncurses. To dispaly
the same thing, lynx/ncurses uses a lot more resources than lynx/slang, which
slows down the display. For example, when displaying the same page,
lynx/ncurses sends 3024 characters (control and printable) to the screen,
while lynx/slang sends only 1266 characters.
 
> The fact is, though, I don't see the *problem* you do.

Try two of the documents I use to test it:

http://earthspace.net/The_sky/sky_top.html
http://weather.ec.gc.ca/forecast/yul.html

Try with lynx/slang and lynx/ncurses and you'll see the difference.

> It may have a lot to do with my almost exclusive use of TeraTerm on a
> Windows machine to access Lynx through a shell account on a Unix machine.
> Recently I have discovered that using the very same Lynx and configuration
> when telnetting from a i386 NetBSD console gives a very different, and I
> must say, much more "rich" view of Lynx (_all_ the fore- and background
> colors exactly as in lynx.cfg).

It may depend on many things but one thing is clear, colors 4 and 5 are not
being correctly displayed by lynx/slang.

> Without knowing how you access Lynx it's hard to say much,

I access it through a shell acces in my ISP. I use a VT100/VT102 terminal
emulator with color support. I dial to my ISP and access the shell.

> but if you don't want COLORs 4 and 5 underlined, then I think you can go
> two routes depending on where you want to redefine them. Easiest might be
> to change your terminfo description, i.e., change smul and rmul (I *think*
> those are the ones.) to nullify them or change them to bold or something
> rather than have underlining.

I dont want to follow that path. By doing that I would be just masking the
problem. I want it to be corrected. It was by doing that that the problem was
masked for so long. I had changed the underline capability in my termcap from
the normal us=\E[4m to us=\E[36m. That way, instead of having characters
underlined on the screen I had them in cyan. The original idea was make
manpages easier to rad. Of course it was also used by lynx. When I decided to
compile and try ncurses I changed everything to the most normal setup
possible and found out the problem with colors 4 and 5 in lynx/slang. A
similar problem was reported by Klaus in lynx/ncurses and it was promptly
corrected.

> The other way would be to patch Lynx to remove the underline attribute
> associated with those colors. To be thorough you probably would have to
> grep through the /src source files for things like "USE_SLANG,"
> "UNDERLINE_," "start_underline," etc.

That's what I wanted to do. I did a grep on underline and tried to find out
where the problem could be but my knowledge of C and of the lynx code didn't
take me anywhere.

> If you get something that works, you may want to submit a patch to
> lynx-dev,

You can be sure I will.

> since as Klaus has pointed out, some (a lot?) of those if clauses with
> USE_SLANG are probably no longer needed.

Do you remember when he mentioned that?

> Klaus also questioned these lines in LYCurses.c:
>    728          SLtt_add_color_attribute(4, SLTT_ULINE_MASK);
>    729          SLtt_add_color_attribute(5, SLTT_ULINE_MASK);
> Maybe you can just delete them; worth a try if underlining is so undesirable.

Et voil�!!! Thank you very much, Henry. Removing those two lines corrected
the problem. I knew it would take a lot less time to correct the problem
than to discuss if the problem is really a problem, if it's "hardcoded" or
not or if one like the way it is or not or if it should be corrected since
it's there for so long without notice.

> Anyway, making the changes that would be necessary to uncouple underlining
> from COLORs 4 and 5 might not be an easy task because of the pervasiveness
> of past reliance on special treatment for slang versus curses.

I don't know whether that change will have side effects but it's working
fine. Here's the patch, which I hope will be incorporated into the next
release:

diff -ur lynx2-8-3old/src/LYCurses.c lynx2-8-3/src/LYCurses.c
--- lynx2-8-3old/src/LYCurses.c Sun Mar 12 19:38:38 2000
+++ lynx2-8-3/src/LYCurses.c    Tue Mar 14 23:56:10 2000
@@ -729,8 +729,6 @@
        size_change(0);
 
 #if (defined(VMS) || defined(UNIX)) && !defined(__CYGWIN__)
-       SLtt_add_color_attribute(4, SLTT_ULINE_MASK);
-       SLtt_add_color_attribute(5, SLTT_ULINE_MASK);
        /*
         *  If set, the blink escape sequence will turn on high
         *  intensity background (rxvt and maybe Linux console).

Thank you very much again and take care.

Ismael
-- 
       ________________________________________________________________
      |                                                                |
      | ISMAEL CORDEIRO            | mailto:[EMAIL PROTECTED]        |
      | Production sound mixer     | http://ismael.cordeiro.com/       |
      | Montr�al - Qu�bec - Canada | ftp://ftp.pubnix.net/users/ismael |
      |________________________________________________________________|

Reply via email to