Hi Larry,

Once again I didn't get a copy of this mail; I guess GMail's hatred of
GNU outbound SMTP hosts is undiminished.

At 2026-09-27T22:58:03-0400, Larry Kollar wrote:
> Guess which chapter of UTP I'm working on right now? :-P 
> 
> I'm a little over halfway through Chapter 5, in the "Displays"
> section.  There are some wild differences between Groff's -ms and what
> UTP documents, when it comes to displays, and I think UTP isn't
> correct. 

I appreciate the vote of confidence in the groff ms implementation.  I
can think of some people who would not start from the same point.  :)

> Quoting from UTP (starting at line 1548 in my copy, but I've been 
> yoinking things around): 
> 
> We have already used 
> . CW .DS 
> and 
> . CW .DE 
> to mark the beginning and end of a static display. 
> To specify a floating display, the closing mark is the same but the 
> beginning is marked by a different macro: 
> . RS 
> . TS 
> tab(#); 
> lf(CW) l l . 
> \&.ID##Same as \f(CW.DS I\fP (indented) but floating 
> \&.LD##Same as \f(CW.DS L\fP (left justified) but floating 
> \&.CD##Same as \f(CW.DS C\fP (center each line) but floating 
> \&.BD##Same as \f(CW.DS B\fP (center display) but floating 
> . TE 

I wouldn't call it a "mark".  It's a macro call.

I assume you're aware of the perils of `CW` as a font name.  (It's fine
as a macro name.)

> But that's not what I see in groff: the .DS x macros do a static keep,
> as documented in both UTP and groff docs, but the .xD macros do no
> keep at all, floating or otherwise .

Right.  That's how we document it and and it's consistent with my
observations, though we don't have comprehensive tests here.  Or do we?
I should check before relying on my memory.

$ ls -1 tmac/tests/s_*
tmac/tests/s_EQ-handles-empty-first-arg.sh
tmac/tests/s_IP-indents-using-paragraph-type-size.sh
tmac/tests/s_IP-respects-inter-sentence-space-in-tags.sh
tmac/tests/s_PN-register-works.sh
tmac/tests/s_R-handles-its-arguments.sh
tmac/tests/s_SH-resets-IP-indentation-amount.sh
tmac/tests/s_TC-works-with-percent-in-custom-titles.sh
tmac/tests/s_XA-literal-no-argument-suppresses-leader.sh
tmac/tests/s_XA-reduces-line-length.sh
tmac/tests/s_automatic-footnote-number-works-in-table.sh
tmac/tests/s_can-start-document-with-DS-call.sh
tmac/tests/s_honor-MINGW-when-two-columns.sh
tmac/tests/s_honor-page-break-after-display.sh
tmac/tests/s_honor-page-break-in-text.sh
tmac/tests/s_mark-column-start-correctly.sh
tmac/tests/s_no-excess-space-around-displays.sh
tmac/tests/s_rejects-too-short-page-lengths.sh
tmac/tests/s_start-document-with-keep-quietly.sh
tmac/tests/s_vertical-margins-are-correct.sh

...so no, I expect not.

That's pre-1.25.0 Git HEAD.  Some of those tests will not be present in
the version you're using.  (You'll have to grab the groff source package
to get a hold of any at all.)

> M.E. Lesk's -ms doc[2] agrees with what I see.

Yes.  Lesk says:

"If you wish to have a long display which [recte: that] may be split
across page boundaries, use .CD, .LD, or .ID in place of the commands
[recte: macro calls] .DS C, .DS L, or .DS I respectively."

-- Lesk, "Typing Documents on the UNIX [sic] System: Using the -ms
   Macros with Troff and Nroff", p. 4.

> Another "interesting" thing I ran across: it looks like .DS requires a
> preceding .br request to work properly.

That should not be the case.

> I've attached a test source document, and nroff outputs for .DS with
> and without a preceding .br , and another using .BD .  Without that
> break, the last line of the paragraph before the display follows the
> display to the next page. If I need to file a formal bug report, I'll
> grimace and get set up on savannah. 

I'll poke my snoot into this, but may be delayed a day or three while
dealing with the security release.

Meanwhile, maybe someone else's snoot will get in there before mine!

> Oh, here's what Kubuntu's groff package says: 
> 
> $ nroff -v 
> GNU nroff (groff) version 1.23.0.1528-d5d4-dirty 
> GNU groff version 1.23.0.1528-d5d4-dirty 

Huh.  Some kind of once-bleeding edge rip from HEAD, then hacked up
locally.  I would complain about the latter, but it's a useful data
point, saying very clearly that they got up to something.

...are you _sure_ this is Kubuntu's groff package?  I can't find any
record of them rolling a custom groff package like this.

That partial commit hash would, timeframe-wise, be consistent with this
commit.

commit d5d437dcff07f6670ac7d2d0fc064f2a02ef8061
Author: G. Branden Robinson <[email protected]>
Date:   Sat Jul 13 14:50:47 2024 -0500

    [preconv]: Improve skipping logic in test.

    * Exit with failure status before test for skip condition.
    * When skipping, report why.
    * Conditionalize fallback character set.  Use the availablity of
      locale(1) as an indicator, but not what it reports for the "C"
      locale's character set because preconv overrides ANSI_X3.4-1968 with
      ISO-8859-1.  On some systems the "C" locale uses UTF-8.   I feel
      certain this heuristic will let me down sooner or later.

Do you think you might have built groff yourself circa July 2024?

What does `type -p nroff` say?

Don't be alarmed, however--as yet I have no evidence that using 1.23.0
stock, 1.24.0, or a bleeding edge groff will affect your "break-before-
display" issue.

> It would be interesting to know where the OG UTP authors came up with
> the floating keep info… is there a version of -ms out there somewhere
> that does it that way?

I've never heard of this being broken in any implementation, but eroff
and sqtroff were big back in the day.  Maybe they broke this, but I have
_no_ artifacts of those releases except for a partial eroff manual.
Certainly no way to measure their behavior.

I would be intensely interested to read sqtroff's "award-winning"
manual.  Presumably the best place to find copies after 35 years is used
bookstores in Toronto.  Assuming all those hoser booksellers haven't
pulped titles that don't move a copy in three decades.

If anyone ever writes up a script for groff's test suite to measure this
behavior, it will be easy for me to check Solaris 10, Heirloom Doctools,
and Plan 9 troffs as well as historical groff behavior, going back to
(but not beyond) groff 1.22.3.

Regards,
Branden

Attachment: signature.asc
Description: PGP signature

Reply via email to