bugGNU troff - Bugs: bug #55320, tmac/an-old.tmac: Add a warning...

 
 

bug #55320: tmac/an-old.tmac: Add a warning about a missing .RS or an extra .RE

Submitted by:  Bjarni Ingi Gislason <bjarniig>
Submitted on:  Sat 29 Dec 2018 02:24:59 AM UTC  
 
Category:  Macro - man Severity:  3 - Normal
Item Group:  New feature Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Planned Release:  None

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 29 Dec 2018 02:24:59 AM UTC, original submission:  

From fc9d7995ce3456f5b568ae72605626320c6c2017 Mon Sep 17 00:00:00 2001
From: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Date: Sat, 29 Dec 2018 02:16:09 +0000
Subject: [PATCH] tmac/an-old.tmac: Add a warning about a missing .RS or an
 extra .RE

  See bug 55319, 'grog.1.man: Fix spelling and remove excess ".RE" lines'.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
---
 tmac/an-old.tmac | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/tmac/an-old.tmac b/tmac/an-old.tmac
index e01c49b1..090b04b5 100644
--- a/tmac/an-old.tmac
+++ b/tmac/an-old.tmac
@@ -616,7 +616,10 @@
.  ft R
..
.
+.\" To check closure of the macro block (end with .RE)
+.nr an-RS-open 0
.de1 RS
+.  nr an-RS-open +1
.  nr an-saved-margin\\n[an-level] \\n[an-margin]
.  nr an-saved-prevailing-indent\\n[an-level] \\n[an-prevailing-indent]
.  ie \\n[.$] .nr an-margin +(n;\\$1)
@@ -627,12 +630,20 @@
..
.
.de1 RE
-.  ie \\n[.$] .nr an-level ((;\\$1) <? \\n[an-level])
-.  el         .nr an-level -1
-.  nr an-level (1 >? \\n[an-level])
-.  nr an-margin \\n[an-saved-margin\\n[an-level]]
-.  nr an-prevailing-indent \\n[an-saved-prevailing-indent\\n[an-level]]
-.  in \\n[an-margin]u
+.  ie \\n[an-RS-open]<=0 \{\
+.    tmc \\*[an-old]: \\n[.F]:\\n[.c] (.\\$0): warning: extra .\\$0 or
+.    tm1 " .RS is missing before it; "an-RS-open" is \\n[an-RS-open].
+.    tm1 "  This macro call is turned into a no-operation call (no op).
+.  \}
+.  el \{\
+.    nr an-RS-open -1
+.    ie \\n[.$] .nr an-level ((;\\$1) <? \\n[an-level])
+.    el         .nr an-level -1
+.    nr an-level (1 >? \\n[an-level])
+.    nr an-margin \\n[an-saved-margin\\n[an-level]]
+.    nr an-prevailing-indent \\n[an-saved-prevailing-indent\\n[an-level]]
+.    in \\n[an-margin]u
+.  \}
..
.
.\" table support
--
2.19.2

Bjarni Ingi Gislason <bjarniig>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bjarniig (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    No changes have been made to this item

    Back to the top


    Powered by Savane 3.5