bug-groff
[Top][All Lists]
Advanced

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

[bug #53043] [PATCH] an-old.tmac: Check the number of arguments for some


From: Bjarni Ingi Gislason
Subject: [bug #53043] [PATCH] an-old.tmac: Check the number of arguments for some macros
Date: Thu, 1 Feb 2018 19:40:14 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

URL:
  <http://savannah.gnu.org/bugs/?53043>

                 Summary: [PATCH] an-old.tmac: Check the number of arguments
for some macros
                 Project: GNU troff
            Submitted by: bjarniig
            Submitted on: Fri 02 Feb 2018 12:40:12 AM UTC
                Category: Macro - man
                Severity: 3 - Normal
              Item Group: Wishlist
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None

    _______________________________________________________

Details:


>From a72d0d93d9f7010b2f22c0e09a77fbf81c444fbc Mon Sep 17 00:00:00 2001
From: Bjarni Ingi Gislason <address@hidden>
Date: Fri, 2 Feb 2018 00:30:25 +0000
Subject: [PATCH] an-old.tmac: Check the number of arguments to macros for
alternating font
 changes

  They are sometimes used with only one argument, or the single one is
meant to be two.

Signed-off-by: Bjarni Ingi Gislason <address@hidden>
---
 tmac/an-old.tmac | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/tmac/an-old.tmac b/tmac/an-old.tmac
index 9ae3b9f9..dd8ca295 100644
--- a/tmac/an-old.tmac
+++ b/tmac/an-old.tmac
@@ -511,7 +511,15 @@
 .
 .ds an-empty \" this is referenced to avoid looping on, e.g., .RB ( \\ )
 .
+.de1 an-inputcheck
+.  if \\$2<2 \{\
+.    tm \\n(.F:\\n(.c (macro \\$1): only \\$2 argument, but more are
expected
+.  \}
+..
+.
 .de1 RI
+.  an-inputcheck \\$0 \\n[.$]
+.
 .  if \\n[.$] \{\
 .    ds an-result \&\f[R]\\$1\"
 .    shift
@@ -526,6 +534,8 @@
 ..
 .
 .de1 IR
+.  an-inputcheck \\$0 \\n[.$]
+.
 .  if \\n[.$] \{\
 .    ds an-result \&\f[I]\,\\$1\f[R]\"
 .    shift
@@ -540,6 +550,8 @@
 ..
 .
 .de1 IB
+.  an-inputcheck \\$0 \\n[.$]
+.
 .  if \\n[.$] \{\
 .    ds an-result \&\f[I]\,\\$1\"
 .    shift
@@ -554,6 +566,8 @@
 ..
 .
 .de1 BI
+.  an-inputcheck \\$0 \\n[.$]
+.
 .  if \\n[.$] \{\
 .    ds an-result \&\f[B]\\$1\"
 .    shift
@@ -568,6 +582,8 @@
 ..
 .
 .de1 RB
+.  an-inputcheck \\$0 \\n[.$]
+.
 .  ds an-result \&\"
 .  while (\\n[.$] >= 2) \{\
 .    as an-result \f[R]\\$1\f[B]\\$2\\*[an-empty]\"
@@ -579,6 +595,8 @@
 ..
 .
 .de1 BR
+.  an-inputcheck \\$0 \\n[.$]
+.
 .  ds an-result \&\"
 .  while (\\n[.$] >= 2) \{\
 .    as an-result \f[B]\\$1\f[R]\\$2\\*[an-empty]\"
-- 
2.15.1






    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?53043>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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