lynx-dev
[Top][All Lists]
Advanced

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

Re: [Lynx-dev] Invoking a lynx script


From: Bela Lubkin
Subject: Re: [Lynx-dev] Invoking a lynx script
Date: Mon, 10 Oct 2011 02:31:10 -0700

Thomas Dickey wrote:

BL>>>> You might use that to advantage, e.g. adding "-width 10000" so that
BL>>>> paragraphs are inserted without line breaks (then vim's :set textwidth=
BL>>>> wrapping will work).  Slight bug there: Lynx has a line length limit of
BL>>>> 1014 chars (from testing); paragraphs longer than that will have
BL>>>> arbitrary line breaks inserted.

TD>>> yes - it's a compile-time limit, used in various buffer-sizes as well
TD>>> as a chunk-size in GridText.c's memory-allocation scheme.

BL>> Yes, documented as LINE_MAX in recent man pages.  I've never tried
BL>> compiling Lynx with an expanded LINE_MAX: does it work or does it run
BL>> into countervailing assumptions elsewhere in the code?  I imagine that

TD> I recall checking in a previous discussion, and found some buffer-sizes
TD> that should be made dependent on that.

Ok, then not for random people to mess with...

BL>> setting it to a large value like 1M would bloat the Lynx process (but
BL>> nothing like a GUI browser...) and probably slow it down as well...

TD> It probably would be slower, though it might be interesting to massage
TD> the code so that it could use plain malloc/free in GridText.c to see
TD> how much faster the current scheme uses.

I was thinking there were probably things like sprintf() or memcpy()
where libc would end up zeroing or copying the entire trailing buffer
after the interesting part.

TD> For the buffer sizes - there are probably some special cases that would
TD> complicate things.

No doubt.

So for my original purpose (avoiding buffer-size-imposed line wrap in
"-dump" output) it might be better to kludge it.  Add a "-dont_wrap"
flag (following the example of "-dont_wrap_pre").  When inserting a
line break due to running out of buffer space, remember the reason;
when actually outputting it, if the reason was "out of space" rather
than "document said so", output the line without a trailing newline.
"-dont_wrap" would also set "-width" to the applicable max (so that the
"out of space, don't newline" path isn't exercised unnecessarily).

Or don't add "-dont_wrap", just turn the behavior on automatically if
"-width" is greater than the build can handle.

>Bela<



reply via email to

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