groff
[Top][All Lists]
Advanced

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

Re: [Groff] need for mom checks in grog


From: Ralph Corderoy
Subject: Re: [Groff] need for mom checks in grog
Date: Wed, 05 Jun 2002 22:40:25 +0100

Hi Bernd,

> Is mom intended to become a standard macro package in groff?

It's in CVS, so I guess so.

> If yes, then a suitable test must be provided in grog, otherwise
> groffer will not be able to display mom files automatically.

OK, a possible patch is below.  Werner, what's the history behind two
grogs, one shell script the other Perl?  It seems to double the work
:-)

> Meanwhile, in all existing mom files, esp. in the mom example files
> there should be an explicit `.mso om.tmac'.

But we don't need to do this unless grog doesn't detect mom and we want
groffer to work with mom documents, right?

Anyway, here's the patch, pretty untested.

Cheers,


Ralph.

Index: src/roff/grog/grog.pl
===================================================================
RCS file: /var/cvs/groff/src/roff/grog/grog.pl,v
retrieving revision 1.12
diff -u -r1.12 grog.pl
--- src/roff/grog/grog.pl       20 Feb 2002 00:56:09 -0000      1.12
+++ src/roff/grog/grog.pl       5 Jun 2002 21:39:03 -0000
@@ -19,13 +19,9 @@
     push(@command, $arg);
 }
 
-if (@ARGV) {
-    foreach $arg (@ARGV) {
-       &process($arg, 0);
-    }
-}
-else {
-    &process("-", 0);
address@hidden = ('-') unless @ARGV;
+foreach $arg (@ARGV) {
+    &process($arg, 0);
 }
 
 sub process {
@@ -152,6 +148,9 @@
            }
            redo;
        }
+        elsif (/^\.(PRINTSTYLE|START)$sp/) {
+            $mom++;
+        }
        if (/^\.so$sp/) {
            chop;
            s/^.so *//;
@@ -194,6 +193,9 @@
 }
 elsif ($SH > 0 && $TH > 0) {
     push(@command, "-man");
+}
+elsif ($mom > 0) {
+    push(@command, "-mom");
 }
 elsif ($PP > 0) {
     push(@command, "-ms");
Index: src/roff/grog/grog.sh
===================================================================
RCS file: /var/cvs/groff/src/roff/grog/grog.sh,v
retrieving revision 1.11
diff -u -r1.11 grog.sh
--- src/roff/grog/grog.sh       11 Feb 2002 10:45:49 -0000      1.11
+++ src/roff/grog/grog.sh       5 Jun 2002 21:39:03 -0000
@@ -71,6 +71,7 @@
                Oo--
        }
 }
+/^\.(PRINTSTYLE|START)/ { mom++ }
 
 END {
        if (files ~ /^-/)
@@ -91,6 +92,8 @@
                printf " -me"
        else if (SH > 0 && TH > 0)
                printf " -man"
+       else if (mom > 0)
+               printf " -mom"
        else if (PP > 0)
                printf " -ms"
        else if (P > 0 || mm > 0)


reply via email to

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