mdoc footer in stable/15 and main doesn't match that of the previous versions, and the formatting isn't the best.
Created attachment 264024 [details] mdoc footer from stable/14 with familiar formatting
Created attachment 264025 [details] mdoc footer from stable/15 with unusual formatting, the main branch is just as bad
That's interesting. The footer format did change to align more closely with groff.
(In reply to Alexander Ziaee from comment #3) The year is missing from the date, and the spacing is off.
I see that, but I'm unable to reproduce it so far. Mine says "$VERSION $DATE $NAME" (which is the change from familiar "$VERSION $DATE $VERSION"). Can you give me some more details about your setup? What is your TERM? Are you seeing this on all manuals, or just specific ones? Anything else that may possibly be relevant?
The footer changed in 15.x and later, but it looks ok. for i in f{13,14,15,16}; do ssh $i 'man mandoc | tail -n1'; done FreeBSD 13.5-STABLE August 14, 2021 FreeBSD 13.5-STABLE FreeBSD 14.3-STABLE March 3, 2025 FreeBSD 14.3-STABLE FreeBSD 15.0-ALPHA2 July 9, 2025 MANDOC(1) FreeBSD 16.0-CURRENT July 9, 2025 MANDOC(1)
I believe the OP is likely talking about mandoc -T ps or -T pdf output mode, but chose to not mention that in this bug report. At least i can reproduce broken formatting of the footer line in roughly the way shown in the two PNG attachments in -T ps and -T pdf output mode on OpenBSD-current. I suspect this is an unfixed regression caused by the massive reorganization committed on 2025-07-16 14:45 with the commit message starting with "In 2009, kristaps@ decided that using EN as the basic unit for horizontal widths on terminal output devices was the simplest option. [...] Fix this by changing many internal variables in the terminal formatter to store widths in units of BU instead of EN, improving compatibility." Contrary to what one might expect, the -T ps and -T pdf output modes are actually submodes of the terminal formatter, which means that this reorg *can* cause fallout in these modes, and the symptoms seem broadly consistent with something going awry with width measurements and/or horizontal alignment. I do not have a fix yet, but i shall investigate, so please bear with me, i hope to provide an update during the next few days. Files potentially involved are mdoc_term.c, term_ps.c, term.c, and the *time*() functions in mandoc.c, and interactions among the functions in these files.
(In reply to Ingo Schwarze from comment #7) I'm sorry I forgot to mention I have a script that runs: mandoc -c -mdoc -O paper=a4 -T pdf
Created attachment 264048 [details] ifconfig(8) rendered as PDF on stable/14
Created attachment 264049 [details] ifconfig(8) rendered as PDF on stable/15
I believe https://cvsweb.bsd.lv/mandoc/term_ps.c revision 1.95 fixes this issue. Sorry for the disruption. The patch term.c rev. 1.292 that you already merged into FreeBSD was quite a major reorganization, and it may take a bit of time to get the dust settled, especially in PostScript and PDF output where it appears i slightly underestimated the consequences. All the same, i counsel against reverting anything because trying to revert such a major change that touched many files would be likely to cause instability, too, and would make it harder for us to coordinate. While you can selectively merge small, additional patches to fix issues affecting you with little effort and risk, selectively reverting a massive reorganization would not look like a good option, especially since you have already started merging some further development on top of it, causing you to potentially run into both physical and logical conflicts, unless you understand very precisely what the code is doing and are very careful about what you can or cannot merge after reverting the reorg. I think i'm seeing one additional issue with TERMP_NOBREAK handling in term_ps.c that i need to investigate, but i first wanted to get this hotfix out of the way, such that you can easily pick it up if you want to.
Thanks Ingo! I'll merge a fresh mandoc today!
(In reply to Alexander Ziaee from comment #12) I think it is time that we add a version parameter (-v) for mandoc. Otherwise it is hard to know which mandoc snapshot is running on someones -stable machine. See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=274246
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=59fc2b0166f71c791113379d16b8cef7039f289d commit 59fc2b0166f71c791113379d16b8cef7039f289d Merge: d4cbdd9ad04a 5fe5b2ed2d88 Author: Alexander Ziaee <ziaee@FreeBSD.org> AuthorDate: 2025-09-29 17:31:38 +0000 Commit: Alexander Ziaee <ziaee@FreeBSD.org> CommitDate: 2025-09-29 17:31:38 +0000 mandoc: Vendor import of upstream at 2025-09-26 Interesting changes: + mandoc db: Improve case sorting, found by our very own markj + history: Add macros for version 8 and 10 AT&T Unix + linter: Warn on blank lines in man(7) like mdoc(7) + manuals: Improve precision, man(7) syntax table, and roff(7) specifics + manuals: Fix PDF/PS footer regression detailed in our PR: 289786 PR: 289786 MFC after: 3 days contrib/mandoc/Makefile | 2 +- contrib/mandoc/dba.c | 7 +++--- contrib/mandoc/main.c | 52 +++++++++----------------------------------- contrib/mandoc/man.c | 3 ++- contrib/mandoc/man.options.1 | 35 +++++++++++++++++++++++++---- contrib/mandoc/mandoc.1 | 16 ++++++++------ contrib/mandoc/mdoc.7 | 35 +++++++++++++++++++---------- contrib/mandoc/roff_term.c | 2 +- contrib/mandoc/term_ps.c | 6 ++--- 9 files changed, 84 insertions(+), 74 deletions(-)
A commit in branch stable/15 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=955d9b0a1093131ac18d57d2764ee716fd428dd9 commit 955d9b0a1093131ac18d57d2764ee716fd428dd9 Author: Alexander Ziaee <ziaee@FreeBSD.org> AuthorDate: 2025-09-29 17:31:38 +0000 Commit: Alexander Ziaee <ziaee@FreeBSD.org> CommitDate: 2025-10-02 02:52:57 +0000 mandoc: Vendor import of upstream at 2025-09-26 Interesting changes: + mandoc db: Improve case sorting, found by our very own markj + history: Add macros for version 8 and 10 AT&T Unix + linter: Warn on blank lines in man(7) like mdoc(7) + manuals: Improve precision, man(7) syntax table, and roff(7) specifics + manuals: Fix PDF/PS footer regression detailed in our PR: 289786 PR: 289786 MFC after: 3 days (cherry picked from commit 59fc2b0166f71c791113379d16b8cef7039f289d) contrib/mandoc/Makefile | 2 +- contrib/mandoc/dba.c | 7 +++--- contrib/mandoc/main.c | 52 +++++++++----------------------------------- contrib/mandoc/man.c | 3 ++- contrib/mandoc/man.options.1 | 35 +++++++++++++++++++++++++---- contrib/mandoc/mandoc.1 | 16 ++++++++------ contrib/mandoc/mdoc.7 | 35 +++++++++++++++++++---------- contrib/mandoc/roff_term.c | 2 +- contrib/mandoc/term_ps.c | 6 ++--- 9 files changed, 84 insertions(+), 74 deletions(-)
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=f763f12ed5eba2c95385dd2f93fc47a66dfa927c commit f763f12ed5eba2c95385dd2f93fc47a66dfa927c Author: Alexander Ziaee <ziaee@FreeBSD.org> AuthorDate: 2025-09-29 17:31:38 +0000 Commit: Alexander Ziaee <ziaee@FreeBSD.org> CommitDate: 2026-02-06 00:31:23 +0000 mandoc: Vendor import of upstream at 2025-09-26 Interesting changes: + mandoc db: Improve case sorting, found by our very own markj + history: Add macros for version 8 and 10 AT&T Unix + linter: Warn on blank lines in man(7) like mdoc(7) + manuals: Improve precision, man(7) syntax table, and roff(7) specifics + manuals: Fix PDF/PS footer regression detailed in our PR: 289786 PR: 289786 MFC after: 3 days (cherry picked from commit 59fc2b0166f71c791113379d16b8cef7039f289d) contrib/mandoc/Makefile | 2 +- contrib/mandoc/dba.c | 7 +++--- contrib/mandoc/main.c | 52 +++++++++----------------------------------- contrib/mandoc/man.c | 3 ++- contrib/mandoc/man.options.1 | 35 +++++++++++++++++++++++++---- contrib/mandoc/mandoc.1 | 16 ++++++++------ contrib/mandoc/mdoc.7 | 35 +++++++++++++++++++---------- contrib/mandoc/roff_term.c | 2 +- contrib/mandoc/term_ps.c | 6 ++--- 9 files changed, 84 insertions(+), 74 deletions(-)
A commit in branch releng/14.4 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=7fa4ccb8e4e74100583dbddafcb0e1a054963d6e commit 7fa4ccb8e4e74100583dbddafcb0e1a054963d6e Author: Alexander Ziaee <ziaee@FreeBSD.org> AuthorDate: 2025-09-29 17:31:38 +0000 Commit: Colin Percival <cperciva@FreeBSD.org> CommitDate: 2026-02-06 01:07:07 +0000 mandoc: Vendor import of upstream at 2025-09-26 Interesting changes: + mandoc db: Improve case sorting, found by our very own markj + history: Add macros for version 8 and 10 AT&T Unix + linter: Warn on blank lines in man(7) like mdoc(7) + manuals: Improve precision, man(7) syntax table, and roff(7) specifics + manuals: Fix PDF/PS footer regression detailed in our PR: 289786 Approved by: re (cperciva) PR: 289786 MFC after: 3 days (cherry picked from commit 59fc2b0166f71c791113379d16b8cef7039f289d) (cherry picked from commit f763f12ed5eba2c95385dd2f93fc47a66dfa927c) contrib/mandoc/Makefile | 2 +- contrib/mandoc/dba.c | 7 +++--- contrib/mandoc/main.c | 52 +++++++++----------------------------------- contrib/mandoc/man.c | 3 ++- contrib/mandoc/man.options.1 | 35 +++++++++++++++++++++++++---- contrib/mandoc/mandoc.1 | 16 ++++++++------ contrib/mandoc/mdoc.7 | 35 +++++++++++++++++++---------- contrib/mandoc/roff_term.c | 2 +- contrib/mandoc/term_ps.c | 6 ++--- 9 files changed, 84 insertions(+), 74 deletions(-)