groff-commit
[Top][All Lists]
Advanced

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

[groff] 01/01: Fixes missing warning when a digit is not postfixed to th


From: Peter Schaffter
Subject: [groff] 01/01: Fixes missing warning when a digit is not postfixed to the ROMAN/roman args to LIST.
Date: Mon, 27 Nov 2017 14:33:32 -0500 (EST)

PTPi pushed a commit to branch master
in repository groff.

commit 2d567fda705158bb1a03b75d76faa9f12f6371b8
Author: Peter Schaffter <address@hidden>
Date:   Mon Nov 27 14:28:27 2017 -0500

    Fixes missing warning when a digit is not postfixed to the
    ROMAN/roman args to LIST.
    
    Adds VARIABLE to choice of LIST enumerators.
---
 contrib/mom/BUGS      |  4 ++++
 contrib/mom/om.tmac-u | 28 ++++++++++++++++++++++------
 2 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/contrib/mom/BUGS b/contrib/mom/BUGS
index b84bed2..2e1cc89 100644
--- a/contrib/mom/BUGS
+++ b/contrib/mom/BUGS
@@ -23,6 +23,10 @@ the Subject line or you risk my spam filters nuking your 
message.
 
 Version 2.2-a
 =============
+Omitting postfixed digit from ROMAN/roman args to LIST not
+generating warning.
+---Fixed---
+
 FOOTERS causing infinite loop.
 ---Fixed---
 
diff --git a/contrib/mom/om.tmac-u b/contrib/mom/om.tmac-u
index 98506fc..78576af 100644
--- a/contrib/mom/om.tmac-u
+++ b/contrib/mom/om.tmac-u
@@ -15662,18 +15662,17 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .    if !'\\*[$1ST_LETTER]'' .substring $1ST_LETTER 0 0
 .    if '\\*[$1ST_LETTER]'r' .ds $1ST_LETTER R
 .    ie '\\*[$1ST_LETTER]'R' \{\
+.       if r #ROMAN_LIST .rr #ROMAN_LIST
+.       if '\\$1'ROMAN'  .nr #ROMAN_LIST 1
+.       if '\\$1'roman'  .nr #ROMAN_LIST 1
 .       ds $LAST_CHAR \\$1
 .       substring $LAST_CHAR -1
 .       if !\B'\\*[$LAST_CHAR]' \{\
-.          if !'\\$1'ROMAN' \{\
+.          if !r #ROMAN_LIST \{\
 .             LIST OFF
 .             return
 .          \}
-.          if !'\\$1'roman' \{\
-.             LIST OFF
-.             return
-.          \}
-.          tm1 "[mom]: You must append a number to the \\$1 argument to \\$0.
+.          tm1 "[mom]: You must append a number to the '\\$1' argument to \\$0.
 .          tm1 "       The number should be the total number of items in this 
list.
 .          tm1 "       See the documentation.
 .          ab   [mom]: Aborting '\\n[.F]' at \\$0, line \\n[.c].
@@ -15807,6 +15806,19 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .          ds $SEPARATOR\\n[#DEPTH]
 .          ds $PREFIX\\n[#DEPTH]
 .       \}
+.       if '\\*[$LIST_ARG_1]'VARIABLE' \{\
+.          if \\n[#NUM_ARGS]<2 \{\
+.             tm1 "[mom]: You must follow the \\$1 argument to \\$0 with the 
widest
+.             tm1 "       enumerator to be used.  See the documentation.
+.             ab   [mom]: Aborting '\\n[.F]' at \\$0, line \\n[.c].
+.          \}
+.          nr #ARGS_TO_LIST 1
+.          ds $ENUMERATOR\\n+[#DEPTH]
+.          ds $ENUMERATOR_TYPE\\n[#DEPTH] variable
+.          ds $ENUMERATOR_WIDTH\\n[#DEPTH] \w'\\$2\ '
+.          ds $SEPARATOR\\n[#DEPTH]
+.          ds $PREFIX\\n[#DEPTH]
+.       \}
 .       if '\\*[$LIST_ARG_1]'PLAIN' \{\
 .          nr #ARGS_TO_LIST 1
 .          ds $ENUMERATOR\\n+[#DEPTH]
@@ -15848,6 +15860,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .       GET_ROMAN_INDENT
 .    if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'other' \
 .       nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$ENUMERATOR\\n[#DEPTH]]\ '
+.    if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'variable' \
+.       nr #LIST_INDENT\\n[#DEPTH] \\*[$ENUMERATOR_WIDTH\\n[#DEPTH]]
 .    ll \\n[#CURRENT_L_LENGTH]u
 .    ie \\n[#DEPTH]=1 \{\
 .       ie \\n[#INDENT_ACTIVE]=1 \{\
@@ -16007,6 +16021,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .       \}
 .       if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'other' \
 .          PRINT \\*[$ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
+.       if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'variable' \
+.          PRINT  \\$1
 .    \}
 .    rr #SEP_TYPE
 .    EOL



reply via email to

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