Page MenuHomeFreeBSD

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

Authored by vangyzen on May 18 2022, 2:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jan 17, 12:44 PM
Unknown Object (File)
Fri, Jan 17, 12:44 PM
Unknown Object (File)
Fri, Jan 17, 12:43 PM
Unknown Object (File)
Fri, Jan 17, 12:43 PM
Unknown Object (File)
Fri, Jan 17, 10:30 AM
Unknown Object (File)
Sat, Jan 11, 11:29 AM
Unknown Object (File)
Dec 6 2024, 10:01 PM
Unknown Object (File)
Dec 4 2024, 8:55 PM
Subscribers

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
rS FreeBSD src repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 45621
Build 42509: arc lint + arc unit

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.May 31 2022, 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.