gbranden pushed a commit to branch master
in repository groff.

commit 148eaa36d54fb98a9a82d14732f33f7cc958b9a1
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun Jul 20 17:18:31 2025 -0500

    [man]: Add `mN` register.
    
    ...to track whether we're setting a synopsis, because that status
    overrides some formatting choices.
    
    * tmac/an-ext.tmac: Define the register as off/false by default.
      (SY): Make it true.
      (YS): Make it false.
    
    * tmac/an.tmac (reset-hyphenation-mode): Disable automatic hyphenation
      in synopses regardless of document or user preference configuration.
---
 ChangeLog        | 12 ++++++++++++
 tmac/an-ext.tmac |  5 ++++-
 tmac/an.tmac     |  2 ++
 3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 3e7a128a6..8214a1cf2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2025-07-20  G. Branden Robinson <[email protected]>
+
+       [man]: Add `mN` register to track whether we're setting a
+       synopsis, because that status overrides some formatting choices.
+
+       * tmac/an-ext.tmac: Define the register as off/false by default.
+       (SY): Make it true.
+       (YS): Make it false.
+       * tmac/an.tmac (reset-hyphenation-mode): Disable automatic
+       hyphenation in synopses regardless of document or user
+       preference configuration.
+
 2025-07-15  G. Branden Robinson <[email protected]>
 
        * tmac/an.tmac: Refactor to simplify.
diff --git a/tmac/an-ext.tmac b/tmac/an-ext.tmac
index 32c1fb029..c683eb197 100644
--- a/tmac/an-ext.tmac
+++ b/tmac/an-ext.tmac
@@ -1,6 +1,6 @@
 .\" groff extension macros for man(7) package
 .\"
-.\" Copyright (C) 2007-2024 Free Software Foundation, Inc.
+.\" Copyright (C) 2007-2025 Free Software Foundation, Inc.
 .\"
 .\" Written by Eric S. Raymond <[email protected]>
 .\"            Werner Lemberg <[email protected]>
@@ -51,6 +51,7 @@
 .    do nr mH \\n[.hy] \" groff extension register
 ..
 .
+.nr mN 0 \" in a synopsis (SY/YS)?
 .nr mS 0 \" reuse indentation of previous synopsis?
 .nr mE 0 \" in an example (EX/EE)?
 .
@@ -59,6 +60,7 @@
 .\" .SY keyword [punctuation]
 .de SY
 .  ie \\n(.$ \{\
+.    nr mN 1
 .    if !\\n(mS \{\
 .      nr mI \\n(.i
 .      nr mT \\n(.k+\w'\fB\\$1\fP'
@@ -102,6 +104,7 @@
 .\" reuses the indentation computed for the one ended by this call.
 .\" .YS [argument]
 .de YS
+.  nr mN 0
 .  in \\n(mIu
 .  ad \\n(mA
 .  hy \\n(mH
diff --git a/tmac/an.tmac b/tmac/an.tmac
index 695152b02..4a05de6cc 100644
--- a/tmac/an.tmac
+++ b/tmac/an.tmac
@@ -126,6 +126,8 @@
 .de an*reset-hyphenation-mode
 .  nr an*want-hyphenation 1
 .  if r HY .if !\\n[HY] .nr an*want-hyphenation 0
+.  \" We don't want automatic hyphenation in synopses; see an-ext.tmac.
+.  if r mN .if \\n[mN]  .nr an*want-hyphenation 0
 .  ie \\n[an*want-hyphenation] \
 .    nr an*hyphenation-mode \\n[\\*[locale]*hyphenation-mode-trap]
 .  el .nr an*hyphenation-mode 0

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

Reply via email to