On Fri, Dec 13, 2024 at 02:13:44PM -0700, Glenn Golden wrote:
>While the patient is on the table, might it be possible to also look into 
>this: 
>
>    https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74107
>
>From what Padraig said in his response to the above report, it sounded like 
>fixing it on the source side (modifying -help output) is one way that had been 
>discussed to avoid it, but just wondering (since you're going to be working
>on it anyway) if it might be possible for help2man to recognize the type of 
>indentation construct that results in the extra vertical space and just avoid
>inserting an addtional ".IP"?

The problem is that the indentation of wrapped lines doesn't
match. e.g.:

    -f, --follow[={name|descriptor}]
                             output appended data as the file grows;
                               an absent option argument means 'descriptor'

so the line starting with "an absent ..." is rendered as a separate
indented paragraph rather than the intended continuation of the previous
tagged paragraph:

  .TP
  \fB\-f\fR, \fB\-\-follow[=\fR{name|descriptor}]
  output appended data as the file grows;
  .IP
  an absent option argument means 'descriptor'

If the additional two spaces are removed:

    -f, --follow[={name|descriptor}]
                             output appended data as the file grows;
                             an absent option argument means 'descriptor'

it is interpreted as a continuation, and included in the same paragraph:

  .TP
  \fB\-f\fR, \fB\-\-follow[=\fR{name|descriptor}]
  output appended data as the file grows;
  an absent option argument means 'descriptor'

This is a bit tricky to get right for all inut: help2man is trying to
apply semantic meaning to arbitrary text, and changing the heuristic for
one use case has broken others in the past.  Which makes me cautious
about changing the default behaviour to accomodate the indented
continuation lines used by tail.

I have however added a new --loose-indent option for the next release
which will be a bit more relaxed about matching continuations such as
used by tail:

  
https://salsa.debian.org/bod/help2man/-/commit/8fe02612ad71e237b1cf76054131d5b62e0c0da8

The tail manual page generated with that new option is attached.

--bod

Attachment: tail.1.gz
Description: application/gzip

Reply via email to