gbranden pushed a commit to branch master
in repository groff.

commit 4bdcefea1dea94b7991f1626e53ce5a22ff194d4
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Jun 6 13:24:10 2025 -0500

    tmac/an-ext.tmac: Don't use \c after 1 arg to SY.
    
    * tmac/an-ext.tmac (SY): The single-argument form of `SY` need not set
      an ubreakable space and output line continuation character after
      formatting the argument.  That distinction is in fact the whole point
      of accepting a second argument (a new post-1.23 feature), which is set
      in bold like the first.  (It is why you would write `.SY foo bar`
      rather than `.SY "foo bar".)
    
    * tmac/groff_man.7.man.in (Synopsis macros) <SY>: Document this fact.
    
    Fixes a regression from groff 1.23.0.  Thanks to Alex Colomar for the
    report.
---
 ChangeLog                           | 14 ++++++++++++++
 tmac/an-ext.tmac                    |  2 +-
 tmac/groff_man.7.man.in             |  6 ++++++
 tmac/tests/an-ext_SY-and-YS-work.sh | 22 +++++++++++++++++++++-
 4 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0ab5eba81..ff8ff3c28 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2025-06-06  G. Branden Robinson <[email protected]>
+
+       * tmac/an-ext.tmac (SY): The single-argument form of `SY` need
+       not set an ubreakable space and output line continuation
+       character after formatting the argument.  That distinction is in
+       fact the whole point of accepting a second argument (a new
+       post-1.23 feature), which is set in bold like the first.  (It is
+       why you would write `.SY foo bar` rather than `.SY "foo bar".)
+       * tmac/groff_man.7.man.in (Synopsis macros) <SY>: Document this
+       fact.
+
+       Fixes a regression from groff 1.23.0.  Thanks to Alex Colomar
+       for the report.
+
 2025-06-05  G. Branden Robinson <[email protected]>
 
        * src/devices/grohtml/post-html.cpp: Fix code style nits.
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 @@
 .      \" 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 @@ and any
 .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:

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to