Page MenuHomeFreeBSD

mandoc: workaround lack of macro parsing in list -width
ClosedPublic

Authored by vangyzen on May 18 2022, 2:39 PM.

Details

Summary

GNU tools parse macros in the -width argument of lists. mandoc does not,
so it calculates an excessive width. This often squeezes the text into
a very narrow column, especially in nested lists.

Implement the easy workaround suggested in the TODO list. When there is
only one macro, at the beginning of the -width argument, this fixes the
formatting as well as a complete solution.

Relnotes: yes
MFC after: 1 week
Sponsored by: Dell EMC Isilon

I won't commit this directly. I'll submit it upstream first.

Test Plan

See the diffs of formatted pages.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

vangyzen edited the summary of this revision. (Show Details)
vangyzen added a reviewer: manpages.
vangyzen edited the test plan for this revision. (Show Details)

Pages formatted with the old and new code.

Phabricator did not quite do what I wanted. There are two diffs here: formatted pages, and code. See the History tab.

Have you proposed this patch to upstream? ingo@openbsd.org is very responsive and should reply back quickly, before adding any custom patch I prefer it to be discussed with upstream first. (don't hesitate to CC me)

Have you proposed this patch to upstream? ingo@openbsd.org is very responsive and should reply back quickly, before adding any custom patch I prefer it to be discussed with upstream first. (don't hesitate to CC me)

Nice timing. I was just looking for the right mailing list. Thanks for the pointer! (I used Phab only as a convenient way to format the diffs.)

This revision was not accepted when it landed; it landed in state Needs Review.Tue, May 31, 3:09 PM
This revision was automatically updated to reflect the committed changes.

Ingo will commit something similar in the near future, and Baptiste will import a new release of mandoc. For now, Bapt approved this commit.