Re: reformatting man pages at SIGWINCH

2023-04-16 Thread G. Branden Robinson
[CC list trimmed of Texinfo people/lists] At 2023-04-11T11:39:11+0200, Dirk Gouders wrote: [I wrote:] > > 4. A habit has grown up among man(1) programs and pagers to call > > for and support, respectively, a "blank line squeezing" feature: any > > runs of more than one blank line are condensed to

Re: reformatting man pages at SIGWINCH

2023-04-11 Thread Dirk Gouders
Hi Branden, "G. Branden Robinson" writes: > At 2023-04-10T21:05:24+0200, Dirk Gouders wrote: >> This relies on the assumption that horizontal resizes don't create or >> delete emty lines and it still has the weakness that manual pages >> (e.g. bash(1)) contain large areas without empty lines but

Re: reformatting man pages at SIGWINCH

2023-04-11 Thread Ralph Corderoy
Hi Branden, > see man pages as they would have formatted for Western Electric > Teletype machines, which printed to long spools of paper with 66 lines > to the nominal page. In case it isn't obvious, it was normal for teletypes and line printers to print six lines per inch onto letter-height fan-

Re: reformatting man pages at SIGWINCH

2023-04-10 Thread G. Branden Robinson
Hi Dirk, At 2023-04-10T21:05:24+0200, Dirk Gouders wrote: > This relies on the assumption that horizontal resizes don't create or > delete emty lines and it still has the weakness that manual pages > (e.g. bash(1)) contain large areas without empty lines but it's > definitely better than just stay

Re: reformatting man pages at SIGWINCH

2023-04-10 Thread Alejandro Colomar
Hi Dirk, On 4/10/23 21:05, Dirk Gouders wrote: >> For something simpler, you could just count words since the start of the >> section divided by total words in the section. That should be fast, and >> I expect, also quite precise. Hyphenating might work against you on >> this, but on average it

Re: reformatting man pages at SIGWINCH

2023-04-10 Thread Dirk Gouders
Hi Alex, Alejandro Colomar writes: > On 4/8/23 00:09, Dirk Gouders wrote: >>> Maybe it could be done with .SH and .SS. The heuristics to find these >>> are simple. It wouldn't be very precise, but it could try to find the >>> closest (only upwards) (sub)section heading. With some luck, .TP wo

Re: reformatting man pages at SIGWINCH

2023-04-08 Thread Ralph Corderoy
Hi, > > > (1) what part of the screen was the reader actually looking at? less(1) has -j; that would be a good start. > > > (2) how is the pager supposed to know how to map any given > > > location on the screen back to a place in the unrendered source > > > document so it can be accurately foun

Re: reformatting man pages at SIGWINCH

2023-04-07 Thread Dirk Gouders
Alejandro Colomar writes: > Hi Branden, > > On 4/7/23 04:18, G. Branden Robinson wrote: >> At 2023-04-06T03:10:59+0200, Alejandro Colomar wrote: >>> Hmm, now that I think, it's probably an issue of coordinating man(1) >>> and less(1). I sometimes wish that when I resize a window where I'm >>> re

Re: reformatting man pages at SIGWINCH

2023-04-07 Thread Alejandro Colomar
Hi Dirk, On 4/8/23 00:09, Dirk Gouders wrote: >> Maybe it could be done with .SH and .SS. The heuristics to find these >> are simple. It wouldn't be very precise, but it could try to find the >> closest (only upwards) (sub)section heading. With some luck, .TP would >> also be helpful. > > Yes,

reformatting man pages at SIGWINCH (was: Playground pager lsp(1))

2023-04-07 Thread Alejandro Colomar
Hi Branden, On 4/7/23 04:18, G. Branden Robinson wrote: > At 2023-04-06T03:10:59+0200, Alejandro Colomar wrote: >> Hmm, now that I think, it's probably an issue of coordinating man(1) >> and less(1). I sometimes wish that when I resize a window where I'm >> reading a man page, it would reformat t