gbranden pushed a commit to branch master in repository groff. commit b65066ea49c34b92f255a7e9dde62b31b296ea5f Author: G. Branden Robinson <g.branden.robin...@gmail.com> AuthorDate: Thu Jul 17 16:13:33 2025 -0500
[mdoc]: Disable hyphenation less aggressively. * tmac/doc.tmac (doc-parse-args, doc-parse-arg-vector) (doc-enclose-close, doc-inset-list, doc-hang-list) (doc-ohang-list, doc-diag-list, doc-tag-list, Fc) (doc-print-reference): Stop invoking `nh` request. This package's bespoke internal macro reprocessing system aggressively exercises Savannah #67310 (a missing feature in the formatter); with these requests in place, automatic hyphenation was getting disabled in far more places than it should have been, and because there appears to be no mechanism for reënabling it when departing the appropriate nested scope, it's simpler to just stop trying. Making this change had no measurable effect on formatting of groff_mdoc(7), except with respect to the formatting of URL link text, which has seen heavy revision since groff 1.23.0 anyway. (Lk): Macro now does what more mdoc(7) documents should probably have already been doing: employ the `\%` escape sequence in appropriate places. (Alternatively, those who enjoy mandoc(1)'s approach can disable automatic hyphenation altogether at formatting time by setting the `HY` register to zero in "mdoc.local" or on the command line.) This change eliminates the one regression noted above. * tmac/tests/doc_indents-correctly.sh: Update test expectations, now that (sub)section headings that are so long that they break can also hyphenate. --- ChangeLog | 30 ++++++++++++++++++++++++++++++ tmac/doc.tmac | 18 ++---------------- tmac/tests/doc_indents-correctly.sh | 4 ++-- 3 files changed, 34 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index fb6b8bf49..8f837bfc7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,33 @@ +2025-07-17 G. Branden Robinson <g.branden.robin...@gmail.com> + + [mdoc]: Disable hyphenation less aggressively. + + * tmac/doc.tmac (doc-parse-args, doc-parse-arg-vector) + (doc-enclose-close, doc-inset-list, doc-hang-list) + (doc-ohang-list, doc-diag-list, doc-tag-list, Fc) + (doc-print-reference): Stop invoking `nh` request. This + package's bespoke internal macro reprocessing system + aggressively exercises Savannah #67310 (a missing feature in the + formatter); with these requests in place, automatic hyphenation + was getting disabled in far more places than it should have + been, and because there appears to be no mechanism for + reënabling it when departing the appropriate nested scope, it's + simpler to just stop trying. Making this change had no + measurable effect on formatting of groff_mdoc(7), except with + respect to the formatting of URL link text, which has seen heavy + revision since groff 1.23.0 anyway. + (Lk): Macro now does what more mdoc(7) documents should probably + have already been doing: employ the `\%` escape sequence in + appropriate places. (Alternatively, those who enjoy mandoc(1)'s + approach can disable automatic hyphenation altogether at + formatting time by setting the `HY` register to zero in + "mdoc.local" or on the command line.) This change eliminates + the one regression noted above. + + * tmac/tests/doc_indents-correctly.sh: Update test expectations, + now that (sub)section headings that are so long that they break + can also hyphenate. + 2025-07-17 G. Branden Robinson <g.branden.robin...@gmail.com> * tmac/mdoc/doc-common (Sh): Fix missing brace escape sequence. diff --git a/tmac/doc.tmac b/tmac/doc.tmac index 23e257160..70cb79c74 100644 --- a/tmac/doc.tmac +++ b/tmac/doc.tmac @@ -416,8 +416,6 @@ . shift . doc-parse-args \$@ . \} -. -. nh .. .ec . @@ -465,8 +463,6 @@ . nr doc-num-args -1 . doc-parse-arg-vector . \} -. -. nh .. .ec . @@ -2296,7 +2292,6 @@ . chop doc-enclosure-box\n[doc-nesting-level] . unformat doc-enclosure-box\n[doc-nesting-level] . -. nh . nop \*[doc-enclosure-box\n[doc-nesting-level]]\c . nop \)\*[doc-quote-right]\)\c . @@ -4170,7 +4165,6 @@ arguments . doc-set-vertical-and-indent 0 . br . -. nh . doc-item-box\n[doc-list-depth] . . nr doc-in-list 0 @@ -4202,7 +4196,6 @@ arguments . nr doc-reg-dhl (\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u) . ti -\n[doc-reg-dhl]u . -. nh . ie (\n[dl]u > \n[doc-list-indent-stack\n[doc-list-depth]]u) \ . doc-item-box\n[doc-list-depth] . el \{\ @@ -4234,7 +4227,6 @@ arguments . unformat doc-item-box\n[doc-list-depth] . . doc-set-vertical-and-indent 0 -. nh . doc-item-box\n[doc-list-depth] . br . @@ -4355,7 +4347,6 @@ arguments . br . nr doc-diag-list-input-line-count \n[.c] . -. nh . nop \f[\*[doc-Sy-font]]\c . if \n[doc-num-args] \ . doc-remaining-args @@ -4402,7 +4393,6 @@ arguments . nr doc-reg-dtl (\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u) . ti -\n[doc-reg-dtl]u . -. nh . doc-item-box\n[doc-list-depth] . ie (\n[dl]u > \n[doc-list-indent-stack\n[doc-list-depth]]u) \ . br @@ -5571,7 +5561,6 @@ arguments . ti -\n[doc-indent-synopsis]u . \} . -. nh . nop \*[doc-func-box]\c . . nr doc-arg-ptr +1 @@ -5786,9 +5775,6 @@ arguments . .eo .de doc-print-reference -. -. nh -. . if \n[doc-author-count] \{\ . doc-print-reference-authors . nr doc-reference-count -\n[doc-author-count] @@ -7144,12 +7130,12 @@ arguments . \" If we won't/can't hyperlink, format the link target. . if !\n[U] \{\ . nop \" put a breaking space on the output -. nop \[la]\*[doc-target-Lk]\[ra]\c +. nop \%\[la]\*[doc-target-Lk]\[ra]\c . \} . \} . \" If no link text, format the link target as its own link text. . el \ -. nop \f[\*[doc-Lk-font]]\*[doc-target-Lk]\c +. nop \f[\*[doc-Lk-font]]\%\*[doc-target-Lk]\c . nop \f[\n[doc-curr-font]]\c . . doc-end-hyperlink-\*[.T] diff --git a/tmac/tests/doc_indents-correctly.sh b/tmac/tests/doc_indents-correctly.sh index 4a3734e38..2daeaf1d2 100755 --- a/tmac/tests/doc_indents-correctly.sh +++ b/tmac/tests/doc_indents-correctly.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (C) 2022-2024 Free Software Foundation, Inc. +# Copyright (C) 2022-2025 Free Software Foundation, Inc. # # This file is part of groff. # @@ -65,7 +65,7 @@ echo "$output" | grep -Eq '^ A +long +subsection +heading' || wail echo "checking default 'Ss' indentation on 2nd line" >&2 # 3 spaces in string literal. -echo "$output" | grep -Eq '^ indentation of said title is' || wail +echo "$output" | grep -Eq '^ tion of said title is' || wail # Verify that paragraph indentation after subsection heading is correct. echo "checking 'Pp' indentation after 'Ss'" >&2 _______________________________________________ groff-commit mailing list groff-commit@gnu.org https://lists.gnu.org/mailman/listinfo/groff-commit