Follow-up Comment #8, bug #67363 (group groff): Hmm, the paste in comment #6 went event worse than I thought. I don't know how I managed to screw that up so badly.
Trying again. commit 0d5a8fe5db117f3392fa74cb4c228db79c05443f Author: G. Branden Robinson <g.branden.robin...@gmail.com> Date: Tue Jul 15 22:35:05 2025 -0500 [man]: Fix Savannah #67363 (1/4). Make man page rendering more robust against meddling with the hyphenation mode by individual pages. In part this is to ensure that meddling doesn't persist outside the meddlesome document when rendering multiple pages, but it also makes user preferences more reliably discernible. Prompted by a discussion (about adjustment) with Russ Allbery in late 2023. * tmac/an.tmac ([initialization]): When rendering a man page, this macro file is read before any man(7) document: track man/mdoc initialization status in new register `andoc*is-initialized`. When initializing, if the `HY` register is set, we know it was specified on the command line or by the "man.local" file. Stash its value in new register `andoc*HY` so it can be recovered after meddling by the document. (an*reset-hyphenation-mode): Accept an argument, and if valid, assign its value to the `HY` register. (TH): Remove the potentially page-local `HY` register when starting a new document, and call `an*reset-hyphenation-mode` interpolating `andoc*HY` as an argument to impose the user's preference (or the package default) at each new document. * tmac/tests/an_hyphenation-mode-restoration-works.sh: Add test to verify preservation of document- and user-selected hyphenation mode. * tmac/tmac.am (tmac_TESTS): Run test. Fixes <https://savannah.gnu.org/bugs/?67363> (1/4). Thanks to Russ Allbery for posing the challenge. commit 54fb0303cfd59873dd9dc8aab3a47f1e7eff1341 Author: G. Branden Robinson <g.branden.robin...@gmail.com> Date: Tue Jul 15 23:15:56 2025 -0500 [man]: Fix Savannah #67363 (2/4). Make man page rendering more robust against meddling with the adjustment mode by individual pages. In part this is to ensure that meddling doesn't persist outside the meddlesome document when rendering multiple pages, but it also makes user preferences more reliably discernible. Prompted by a discussion with Russ Allbery in late 2023. * tmac/an.tmac ([initialization]): When rendering a man page, this macro file is read before any man(7) document: therefore, when interpreting a man page package macro file for the first time (which we know thanks to the `andoc*is-initialized` register), if the `AD` string is set, we know it was specified on the command line or by the "man.local" file. Stash its value in new string `andoc*AD` so it can be recovered after meddling by the document. (an*reset-adjustment-mode): New macro assumes responsibility for configuring adjustment. Accept an argument, and if valid, assign its contents to the `AD` string. (an*reset-paragraph-parameters): Stop manipulating adjustment in favor of calling the new macro. (TH): Remove the potentially page-local `AD` string when starting a new document, and call `an*reset-adjustment-mode` interpolating `andoc*AD` as an argument to impose the user's preference (or the package default) at each new document. * tmac/tests/an_adjustment-mode-restoration-works.sh: Add test to verify preservation of document- and user-selected adjustment mode. * tmac/tmac.am (tmac_TESTS): Run test. Fixes <https://savannah.gnu.org/bugs/?67363> (2/4). Thanks to Russ Allbery for posing the challenge. commit e0a498b6bc2a0b209616910bfa16d33a8453139c Author: G. Branden Robinson <g.branden.robin...@gmail.com> Date: Mon Jul 21 19:27:59 2025 -0500 [mdoc]: Fix Savannah #67363 (3/4). Make man page rendering more robust against meddling with the hyphenation mode by individual pages. In part this is to ensure that meddling doesn't persist outside the meddlesome document when rendering multiple pages, but it also makes user preferences more reliably discernible. Prompted by a discussion (about adjustment in man(7)) with Russ Allbery in late 2023. * tmac/doc.tmac ([initialization]): When rendering a man page, this macro file is read before any mdoc(7) document:track man/mdoc initialization status in new register `andoc*is-initialized`. When initializing, if the `HY` register is set, we know it was specified on the command line or by the "man.local" file. Stash its value in new register `andoc*HY` so it can be recovered after meddling by the document. * tmac/mdoc/doc-common (Dd): Remove the potentially page-local `HY` register when starting a new document, and call `doc-reset-hyphenation-mode` interpolating `andoc*HY` as an argument to impose the user's preference (or the package default) at each new document. (doc-reset-hyphenation-mode): Accept an argument, and if valid, assign its value to the `HY` register. (Sh): Configure hyphenation _after_ determining formatting parameters dependent on the name of the section heading. Move `nh` request out of control branch matching the `doc-sec-head` and `doc-section-synopsis` strings. Later, invoke `nh` if we're in a synopsis section and `doc-reset-hyphenation-mode` otherwise. (Ss): Invoke `nh` if we're in a synopsis section and `doc-reset-hyphenation-mode` otherwise. As a side effect, this subjects subsection headings to hyphenation. (Section headings produced by the `Sh` macro already were.) * tmac/tests/doc_hyphenation-mode-restoration-works.sh: Add test to verify preservation of document- and user-selected hyphenation modes. * tmac/tmac.am (tmac_TESTS): Run test. Fixes <https://savannah.gnu.org/bugs/?67363> (3/4). Thanks to Russ Allbery for posing the challenge. commit 8d53c2f4f38723164f64f5df94861ea1bc2fb2dc Author: G. Branden Robinson <g.branden.robin...@gmail.com> Date: Wed Jul 16 12:10:45 2025 -0500 [mdoc]: Fix Savannah #67363 (4/4). Make man page rendering more robust against meddling with the adjustment mode by individual pages. In part this is to ensure that meddling doesn't persist outside the meddlesome document when rendering multiple pages, but it also makes user preferences more reliably discernible. Prompted by a discussion with Russ Allbery (about man(7)) in late 2023. * tmac/doc.tmac ([initialization]): When rendering a man page, this macro file is read before any mdoc(7) document; therefore, if the `AD` string is set, we know it was specified on the command line or by the "mdoc.local" file. Stash its value in new string `andoc*AD` so it can be recovered after meddling by the document. * tmac/mdoc/doc-common (Dd): Remove the potentially page-local `AD` string when starting a new document, and call `an*reset-adjustment-mode` interpolating `andoc*AD` as an argument to impose the user's preference (or the package default) at each new document. (doc-reset-adjustment-mode): New macro. Recover that value. Compute the desired adjustment mode based on, in descending priority: (1) the user's preference; (2) the page's preference. (Sh): Configure adjustment _after_ determining formatting parameters dependent on the name of the section heading. Move `na` request out of control branch matching the `doc-sec-head` and `doc-section-synopsis` strings. Later, invoke `na` if we're in a synopsis section and `doc-reset-adjustment-mode` otherwise. (Ss): Invoke `na` if we're in a synopsis section and `doc-reset-adjustment-mode` otherwise. * tmac/tests/doc_user-preferred-adjustment-restored.sh: Add test to verify preservation of user-selected adjustment mode. * tmac/tmac.am (tmac_TESTS): Run test. Fixes <https://savannah.gnu.org/bugs/?67363> (4/4). Thanks to Russ Allbery for posing the challenge. _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?67363> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/
signature.asc
Description: PGP signature