groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 20/26: [man]: Really implement new `YS` feature.


From: G. Branden Robinson
Subject: [groff] 20/26: [man]: Really implement new `YS` feature.
Date: Sat, 13 Jul 2024 16:20:53 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit f680c55d38a7a393a085f616be7de572facaab21
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Jul 13 10:07:54 2024 -0500

    [man]: Really implement new `YS` feature.
    
    Continues commits a08908f982, 3 May, and 89fba7bf96, 6 May.
    
    * tmac/an-ext.tmac: Fix incomplete changes to support `YS` with an
      argument to reuse indentation of previous synopsis.  (An
      insufficiently aggressive test case is a dangerous thing.) Revise
      meaning of `mS` register from "are we in a synopsis?" to "are we
      reusing the previous synopsis's indentation?"
    
      (SY): Save hyphenation and adjustment modes and disable
      automatic hyphenation if we have any arguments.
    
      (YS): Set `mS` register if we have any arguments, otherwise
      clear it.
    
    * tmac/tests/an_HY-register-works.sh: Drop test cases on "nested"
      synopses.  These are now ill-formed and no longer supported.  See
      "NEWS" file.
---
 ChangeLog                          | 16 ++++++++++++++++
 tmac/an-ext.tmac                   | 14 +++++++-------
 tmac/tests/an_HY-register-works.sh | 24 ------------------------
 3 files changed, 23 insertions(+), 31 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 127d91da0..59b7091e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2024-07-13  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * tmac/an-ext.tmac: Fix incomplete changes to support `YS` with
+       an argument to reuse indentation of previous synopsis.  (An
+       insufficiently aggressive test case is a dangerous thing.)
+       Revise meaning of `mS` register from "are we in a synopsis?" to
+       "are we reusing the previous synopsis's indentation?"
+       (SY): Save hyphenation and adjustment modes and disable
+       automatic hyphenation if we have any arguments.
+       (YS): Set `mS` register if we have any arguments, otherwise
+       clear it.
+
+       * tmac/tests/an_HY-register-works.sh: Drop test cases on
+       "nested" synopses.  These are now ill-formed and no longer
+       supported.  See "NEWS" file.
+
 2024-07-13  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * tmac/tests/an-ext_SY-and-YS-work.sh: Test new behavior of `YS`
diff --git a/tmac/an-ext.tmac b/tmac/an-ext.tmac
index 05ce17c70..9c59c5081 100644
--- a/tmac/an-ext.tmac
+++ b/tmac/an-ext.tmac
@@ -49,7 +49,7 @@
 .    do nr mH \\n[.hy] \" groff extension register
 ..
 .
-.nr mS 0 \" in a synopsis (SY/YS)?
+.nr mS 0 \" reuse indentation of previous synopsis?
 .nr mE 0 \" in an example (EX/EE)?
 .
 .
@@ -57,10 +57,6 @@
 .de SY
 .  ie \\n(.$ \{\
 .    if !\\n(mS \{\
-.      mY
-.      nh
-.      nr mS 1
-.      nr mA \\n(.j
 .      nr mI \\n(.i
 .      nr mT \\n(.k+\w'\fB\\$1\fP'
 .      if \\n(.$=1 \
@@ -69,6 +65,9 @@
 .        nr mT +\w'\fB\\$2\fP'
 .    \}
 .
+.    mY
+.    nh
+.    nr mA \\n(.j
 .    ad l
 .    \" Ensure that a partially collected line exists so that the `in`
 .    \" request affects only _subsequent_ output lines.  (CSTR #54 ยง6)
@@ -101,9 +100,10 @@
 .  in \\n(mIu
 .  ad \\n(mA
 .  hy \\n(mH
-.  nr mS 0
 .
-.  if !\\n(.$ \{\
+.  ie \\n(.$ .nr mS 1
+.  el \{\
+.    nr mS 0
 .    rr mA
 .    rr mI
 .    rr mT
diff --git a/tmac/tests/an_HY-register-works.sh 
b/tmac/tests/an_HY-register-works.sh
index fc7a7a5ab..9849761d7 100755
--- a/tmac/tests/an_HY-register-works.sh
+++ b/tmac/tests/an_HY-register-works.sh
@@ -49,30 +49,6 @@ echo "$output"
 echo "checking hyphenation when HY is 0" >&2
 echo "$output" | grep -Eq "to +disestablish$" || wail
 
-input='.TH foo 1 2023-01-08 "groff test suite"
-.SH Name
-foo \- frobinicate a bar
-.SH Synopsis
-.SY foo
-.SY foo
-.I arbitrary-argument
-.YS
-.SH Description
-Now is the time for all good citizens to disestablish
-antidisestablishmentarianism.'
-
-output=$(printf "%s\n" "$input" | "$groff" -man -Tascii -P-cbou)
-echo "$output"
-
-echo "checking hyphenation when HY is default and .SY nested" >&2
-echo "$output" | grep -q "antidisestablishmen-$" || wail
-
-output=$(printf "%s\n" "$input" | "$groff" -rHY=0 -man -Tascii -P-cbou)
-echo "$output"
-
-echo "checking hyphenation when HY is 0 and .SY nested" >&2
-echo "$output" | grep -Eq "to +disestablish$" || wail
-
 test -z "$fail"
 
 # vim:set ai et sw=4 ts=4 tw=72:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]