Hello again Alex, At 2025-06-05T09:24:24-0500, G. Branden Robinson wrote: > Yes, I see. Can reproduce with groff's Git trunk. [...] > That sure looks like misbehavior. I'll see what I can figure out. > > > I expect that in the third command, ba*ar should be put on the next > > line and indented. > > Me too.
Fixing this turned out to be straightforward. I had overgeneralized a change I made to support the new two-argument form of `SY`, applying it wrongly to the single-argument form as well. I have a fix, a new test case, and a documentation update. diff --git a/tmac/an-ext.tmac b/tmac/an-ext.tmac index 9008ba596..32c1fb029 100644 --- a/tmac/an-ext.tmac +++ b/tmac/an-ext.tmac @@ -84,7 +84,7 @@ .de SY . \" rules set forth in CSTR #54 ยง6. . if \\n(.g=0:\\n(.X \ ' ti -\\n(mTu -. B \\$1\ \c +. B \\$1 . \} . if \\n(.$>1 \ . B \\$1\\$2\c diff --git a/tmac/groff_man.7.man.in b/tmac/groff_man.7.man.in index 30ccea056..51140a3f9 100644 --- a/tmac/groff_man.7.man.in +++ b/tmac/groff_man.7.man.in @@ -1055,6 +1055,12 @@ .SS "Synopsis macros" .I suffix are set in bold. . +When +.I suffix +is present, +.I "groff man" +sets the next word after it without intervening space. +. If a break is required in subsequent text (up to a paragraphing, sectioning, diff --git a/tmac/tests/an-ext_SY-and-YS-work.sh b/tmac/tests/an-ext_SY-and-YS-work.sh index 71d1199eb..d3c7d3b1a 100755 --- a/tmac/tests/an-ext_SY-and-YS-work.sh +++ b/tmac/tests/an-ext_SY-and-YS-work.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (C) 2023-2024 Free Software Foundation, Inc. +# Copyright (C) 2023-2025 Free Software Foundation, Inc. # # This file is part of groff. # @@ -146,6 +146,26 @@ echo 'checking for automatic hyphenation disablement inside synopsis' \ >&2 echo "$output2" | grep -q 're-$' && wail +input3='. +.TH foo 1 2025-06-06 "groff test suite" +.SH Name +foo \\- frobnicate a bar +.SH Synopsis +.SY foo +.B \\-\\-baz +.YS \\& +. +.P +.SY \\%ridiculously\\-long\\-command\\-name\\-can\\-you\\-believe\\-it +\\%\\-\\-equally\\-bafflingly\\-garrulous\\-and\\-interminable\\-option +.' + +output3=$(echo "$input3" | "$groff" -rLL=80n -man -T ascii -P -cbou) +echo "$output3" + +echo 'checking that long unbreakable words do not overset' >&2 +echo "$output3" | grep -Eq '^ {9}--equally-bafflingly' || wail + test -z "$fail" # vim:set ai et sw=4 ts=4 tw=72: Here's how your reproducer formats now (in my working copy). $ ./build/test-groff -ww -rCHECKSTYLE=3 -man -Tutf8 ./ATTIC/alex.man an.tmac:./ATTIC/alex.man:1: style: .TH missing fifth argument and second argument 's' not a recognized manual section; specify its title a(s) a(s) g foo bar fooooooo baaaaaaaaaaaaaaaaaaaar baaaaaaaaaaaaaaaaaaaaz qwwwwwwwwwwwwwwwwwwwwe zxxxxxxxxxxxxxxxxxxxxc fooooooooooooooooooooooooooooooooooooooooooooooooo baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar f d a(s) Thanks for the report! That's one fewer gob of albumen to spatter my face after the groff 1.24 release. Regards, Branden
signature.asc
Description: PGP signature