gbranden pushed a commit to branch master
in repository groff.

commit c336b1d56c0e4f158ac2063c3a966a41ca8ce98d
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun Jul 20 18:03:38 2025 -0500

    tmac/an.tmac: Refactor adjustment handling.
    
    * tmac/an.tmac (TH): Stop handling adjustment here, instead relying on
      `an*reset-paragraph-parameters`.
    
      ([initialization]): Stop assigning `AD` string a default value if it's
      unspecified by the user (on the command line or via "man.local").
    
    * tmac/tests/an_adjustment-mode-preserved-after-paragraph-tag.sh: Revise
      test expectations.
    
    * man/groff_font.5.man: Stop assuming `AD` string is defined in a hairy
      bit of typesetting.
    
    This change causes a warning diagnostic in the build.
    
    troff:man/groff_font.5:823: warning [page 1, line 9599]: cannot adjust 
line; underset by 23n
    
    This happens when compiling "groff-man-pages.utf8.txt".
    
    If we pipe the command producing that target through "sed -n '9599p'",
    we see this:
    
                width[,[height[,[depth[,[italic‐correction[,[
    
    ...which corresponds to the advisory language in the document text.
    
    groff_font(7):
         The form of the metrics field is as follows (on one line; it may be
         broken here for readability).
    
                width[,[height[,[depth[,[italic‐correction[,[
                left‐italic‐correction[,[subscript‐correction]]]]]]]]]]
    
    So it's fine.
---
 ChangeLog                                          | 16 +++++++++
 contrib/gpinyin/ChangeLog                          |  5 +++
 contrib/gpinyin/gpinyin.1.man                      |  8 +++--
 man/groff_font.5.man                               |  4 ++-
 tmac/an.tmac                                       |  8 ++---
 ...djustment-mode-preserved-after-paragraph-tag.sh | 42 +++++++++++++++++-----
 6 files changed, 66 insertions(+), 17 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 27acfa0f4..4af57817a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2025-07-20  G. Branden Robinson <[email protected]>
+
+       * tmac/an.tmac: Refactor adjustment management.
+       (TH): Stop handling adjustment here, instead relying on
+       `an*reset-paragraph-parameters`.
+       ([initialization]): Stop assigning `AD` string a default value
+       if it's unspecified by the user (on the command line or via
+       "man.local").
+
+       * tmac/tests/\
+       an_adjustment-mode-preserved-after-paragraph-tag.sh: Revise test
+       expectations.
+
+       * man/groff_font.5.man: Stop assuming `AD` string is defined in
+       a hairy bit of typesetting.
+
 2025-07-20  G. Branden Robinson <[email protected]>
 
        * tmac/an.tmac (an*reset-paragraph-parameters): Call
diff --git a/contrib/gpinyin/ChangeLog b/contrib/gpinyin/ChangeLog
index df1a371cf..ae0bedf09 100644
--- a/contrib/gpinyin/ChangeLog
+++ b/contrib/gpinyin/ChangeLog
@@ -1,3 +1,8 @@
+2025-07-15  G. Branden Robinson <[email protected]>
+
+       * gpinyin.1.man: Stop assuming `AD` string is defined in some
+       hairy bits of typesetting.
+
 2023-07-17  G. Branden Robinson <[email protected]>
 
        * gpinyin.pl: Stop endorsing shebang line space myth.  See
diff --git a/contrib/gpinyin/gpinyin.1.man b/contrib/gpinyin/gpinyin.1.man
index b40e12e8e..99e834bb4 100644
--- a/contrib/gpinyin/gpinyin.1.man
+++ b/contrib/gpinyin/gpinyin.1.man
@@ -318,7 +318,9 @@ Useful documents on the World Wide Web related to Pinyin 
include
 .I Pinyin.info: a guide to the writing of Mandarin Chinese in \
 romanization
 .UE ,
-.ad \*[AD]
+.\" XXX: cringe
+.ie d AD .ad \*[AD]
+.el      .ad b
 .
 .br
 .UR http://\:www\:.pinyin\:.info/\:rules/\:where.html
@@ -344,7 +346,9 @@ and
 .I pinyin.sty
 from the CJK macro package for \*[TeX]
 .UE .
-.ad \*[AD]
+.\" XXX: cringe
+.ie d AD .ad \*[AD]
+.el      .ad b
 .
 .RE
 .
diff --git a/man/groff_font.5.man b/man/groff_font.5.man
index cf1001d24..076f9def8 100644
--- a/man/groff_font.5.man
+++ b/man/groff_font.5.man
@@ -821,7 +821,9 @@ it may be broken here for readability).
 .RI [\fB,\fP[ \:\%italic-correction\/\c
 .RI [\fB,\fP[ \:\%left-italic-correction\/\c
 .RI [\fB,\fP[ \:\%subscript-correction ]]]]]]]]]]
-.ad \*[AD]
+.\" XXX: cringe
+.ie d AD .ad \*[AD]
+.el      .ad b
 .
 .
 .P
diff --git a/tmac/an.tmac b/tmac/an.tmac
index d94af8f76..9208896da 100644
--- a/tmac/an.tmac
+++ b/tmac/an.tmac
@@ -171,7 +171,8 @@
 .  ft R
 .  ps \\n[PS]u
 .  vs \\n[VS]u
-.  \" TODO: ad \\*[AD]
+.  ie d AD .ad \\*[AD]
+.  el      .ad b
 .  an*reset-hyphenation-mode
 ..
 .
@@ -307,7 +308,6 @@
 .  nr an-was-tbl-failure-reported 0
 .
 .  an*reset-section-parameters
-.  ad \\*[AD] \" TODO: Handle this in `an*reset-paragraph-parameters`.
 .  an*reset-paragraph-parameters
 .  ll \\n[LL]u
 .  in 0 \" Well-formed documents call `SH` after `TH`.
@@ -1678,10 +1678,6 @@ contains unsupported escape sequence
 .  rm an-msg
 .\}
 .
-.\" adjustment mode
-.if !d AD \
-.  ds AD b\"
-.
 .\" (sub)section heading font
 .if !d HF \
 .  ds HF B\"
diff --git a/tmac/tests/an_adjustment-mode-preserved-after-paragraph-tag.sh 
b/tmac/tests/an_adjustment-mode-preserved-after-paragraph-tag.sh
index aaad571db..29096be92 100755
--- a/tmac/tests/an_adjustment-mode-preserved-after-paragraph-tag.sh
+++ b/tmac/tests/an_adjustment-mode-preserved-after-paragraph-tag.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# Copyright (C) 2024 Free Software Foundation, Inc.
+# Copyright (C) 2024-2025 Free Software Foundation, Inc.
 #
 # This file is part of groff.
 #
@@ -22,7 +22,8 @@ groff="${abs_top_builddir:-.}/test-groff"
 
 # Regression-test Savannah #65462.
 
-input='.TH foo 1 2024-03-15 "groff test suite"
+input='.
+.TH foo 1 2024-03-15 "groff test suite"
 .SH Name
 foo \- frobnicate a bar
 .SH Description
@@ -38,7 +39,8 @@ A dubious practice,
 to be sure,
 but the house style of Perl man pages to date.
 .IR pod2man (1)
-might soon come to support
+from podlators\~6.0
+employs
 .I groff
 1.23'"'"'s
 .B AD
@@ -49,7 +51,7 @@ had the same preference in
 .I nroff
 mode in 1979,
 and did not adjust the text to both margins on terminals
-(using a
+(using the
 .B na
 request),
 though it did when using a typesetter.
@@ -59,14 +61,38 @@ commented out the disablement of adjustment as early as its 
2.0 release
 (1982),
 and appears to have retained that all the way through Solaris 10.
 .P
-The tagged paragraphs above should retain the alignment configured in
-the previous untagged paragraph
-(as should this one).'
+As of
+.I groff
+1.24,
+paragraphing macros reset the adjustment mode to the default configured
+by the user,
+or by the document if the user did not configure one.
+.P
+Due to differences between implementations,
+between
+.I nroff
+and
+.I troff
+modes,
+and to the surprising behavior of the request sequence
+.IP
+.EX
+\&.ad l
+\&.na
+\&.ad
+.EE
+.P
+no useful idioms for use of the
+.B ad
+request
+in man pages have arisen.
+.'
 
 output=$(printf "%s\n" "$input" | "$groff" -man -Tascii -P-cbou)
 echo "$output"
+# Assume adjustment starting from the left on this output line.
 echo "$output" \
-    | grep -q 'had the same preference in nroff mode in 1979'
+    | grep -Eq 'had  +the  +same  +preference in nroff mode in 1979'
 
 exit
 

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

Reply via email to