groff-commit
[Top][All Lists]
Advanced

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

[groff] 05/06: [ms]: Warn when ".TS H" used inside keeps.


From: G. Branden Robinson
Subject: [groff] 05/06: [ms]: Warn when ".TS H" used inside keeps.
Date: Mon, 22 Feb 2021 19:31:57 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit dcfd5e7bfaa4e8eb2a07fa84ae4448f94b5ebd70
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Tue Feb 23 10:51:14 2021 +1100

    [ms]: Warn when ".TS H" used inside keeps.
    
    * tmac/s.tmac: Emit warning diagnostic when using a multi-page table
      with a repeating header (".TS H").
      (KS): Rename diversion from "kp*div" to "kp@div" since the name is now
      referenced outside the keep module.
      (KF): ...similarly for kp@fdiv.
      (generally): Update diversion dereference sites and derived names.
      (@TS): When handling "H" argument, check identity of current diversion
      and emit appropriately worded warning.
---
 ChangeLog   | 12 ++++++++++++
 tmac/s.tmac | 33 ++++++++++++++++++++-------------
 2 files changed, 32 insertions(+), 13 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c2d6dcf..db32a2f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2021-02-23  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * tmac/s.tmac: Emit warning diagnostic when using a multi-page
+       table with a repeating header (".TS H").
+       (KS): Rename diversion from "kp*div" to "kp@div" since the name
+       is now referenced outside the keep module.
+       (KF): ...similarly for kp@fdiv.
+       (generally): Update diversion dereference sites and derived
+       names.
+       (@TS): When handling "H" argument, check identity of current
+       diversion and emit appropriately worded warning.
+
 2021-02-14  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * FOR-RELEASE: Add more procedures and information related to
diff --git a/tmac/s.tmac b/tmac/s.tmac
index 3f057f3..1978ae9 100644
--- a/tmac/s.tmac
+++ b/tmac/s.tmac
@@ -827,26 +827,26 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 .\" Keeps.
 .de KS
 .br
-.di kp*div
+.di kp@div
 ..
 .de KF
 .if !'\\n(.z'' .@error-recover .KF while diversion open
-.di kp*fdiv
+.di kp@fdiv
 .ev k
 .par@reset-env
 .par@reset
 ..
 .de KE
-.ie '\\n(.z'kp*div' .kp*end
+.ie '\\n(.z'kp@div' .kp*end
 .el \{\
-.      ie '\\n(.z'kp*fdiv' .kp*fend
+.      ie '\\n(.z'kp@fdiv' .kp*fend
 .      el .@error .KE without .KS or .KF
 .\}
 ..
-.de @div-end!kp*div
+.de @div-end!kp@div
 .kp*end
 ..
-.de @div-end!kp*fdiv
+.de @div-end!kp@fdiv
 .kp*fend
 ..
 .de kp*need
@@ -859,9 +859,9 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 .di
 .kp*need \\n[dn]
 .ev nf
-.kp*div
+.kp@div
 .ev
-.rm kp*div
+.rm kp@div
 ..
 .\" Floating keeps.
 .nr kp@head 0
@@ -874,12 +874,12 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 .ie \\n[.t]-(\\n[.k]>0*1v)>\\n[dn] \{\
 .      br
 .      ev nf
-.      kp*fdiv
-.      rm kp*fdiv
+.      kp@fdiv
+.      rm kp@fdiv
 .      ev
 .\}
 .el \{\
-.      rn kp*fdiv kp*div!\\n[kp@tail]
+.      rn kp@fdiv kp@div!\\n[kp@tail]
 .      nr kp*ht!\\n[kp@tail] 0\\n[dn]
 .      nr kp@tail +1
 .\}
@@ -905,7 +905,7 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 .              \" back the keep, so that if the last line of the
 .              \" last keep springs the bottom of page trap, a new
 .              \" page will not be started unnecessarily.
-.              rn kp*div!\\n[kp@head] kp*temp
+.              rn kp@div!\\n[kp@head] kp*temp
 .              nr kp@head +1
 .              ev nf
 .              kp*temp
@@ -1812,7 +1812,14 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 ..
 .de @TS
 .sp \\n[DD]u
-.if '\\$1'H' .di tbl*header-div
+.if '\\$1'H' \{\
+.      ds tbl*stem .TS H table inside\"
+.      ie '\\n[.z]'kp@div' .@warning \\*[tbl*stem] .KS/.KE keep
+.      el .if '\\n[.z]'kp@fdiv' \
+.              @warning \\*[tbl*stem] .KF/.KE floating keep
+.      rm tbl*stem
+.      di tbl*header-div
+.\}
 .if '\*(.T'html' \{\
 .      nr tbl*ll \\n[.l]
 .      ll 1000n



reply via email to

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