groff-commit
[Top][All Lists]
Advanced

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

[groff] 01/01: grog.pl: add more first line gessing groff option charact


From: Bernd Warken
Subject: [groff] 01/01: grog.pl: add more first line gessing groff option characters grog.man: order the guessing options
Date: Mon, 26 May 2014 19:28:23 +0000

bwarken pushed a commit to branch master
in repository groff.

commit d65ff2e12f107f096d24497d081c958579dcb1cd
Author: Bernd Warken <address@hidden>
Date:   Mon May 26 21:28:11 2014 +0200

    grog.pl: add more first line gessing groff option characters
    grog.man: order the guessing options
---
 ChangeLog              |    9 ++++++++-
 src/roff/grog/grog.man |   22 +++++++++++++---------
 src/roff/grog/grog.pl  |   28 ++++++++++++++++++++++------
 3 files changed, 43 insertions(+), 16 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 666b18b..235b8b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,11 +1,18 @@
 2014-05-26  Bernd Warken  <address@hidden>
 
+       * src/roff/grog/grog.pl: Add further first line characters for
+       single character `groff' options.
+
+       * src/roff/grog/grog.man: make generated options more readable.
+
+2014-05-26  Bernd Warken  <address@hidden>
+
        * src/roff/grog/grog.pl: Add detection of `.\" [eprt]' as first
        line to `grog'.  Change usage of `$Sp' to reasonable efforts in
        `groff'.
 
        * src/roff/grog/grog.man, man/groff_char.man: Add website for
-       license text, not only the postage address.
+       license text, not only the postal address.
 
 2014-04-03  Steffen Nurpmeso  <address@hidden>
 
diff --git a/src/roff/grog/grog.man b/src/roff/grog/grog.man
index 837772d..539ad69 100644
--- a/src/roff/grog/grog.man
+++ b/src/roff/grog/grog.man
@@ -185,20 +185,24 @@ It tries to guess which of the following
 options are required for running the input under
 .BR groff :
 .BR \-e ,
+.BR \-g ,
+.BR \-G ,
+.BR \-j ,
+.BR \-p ,
+.BR \-R ,
+.BR \-s ,
+.BR \-t .
 .BR \-man ,
+.BR \-mdoc,
+.BR \-mdoc-old,
 .BR \-me ,
 .BR \-mm ,
 .BR \-mom ,
-.BR \-ms ,
-.BR \-mdoc,
-.BR \-mdoc-old,
-.BR \-p ,
-.BR \-R ,
-.BR \-g ,
-.BR \-G ,
-.BR \-s ,
 and
-.BR \-t .
+.BR \-ms .
+.
+.
+.P
 The guessed
 .B groff
 command including those options and the found
diff --git a/src/roff/grog/grog.pl b/src/roff/grog/grog.pl
index 6a246bc..bbecbcb 100644
--- a/src/roff/grog/grog.pl
+++ b/src/roff/grog/grog.pl
@@ -159,7 +159,11 @@ sub process {
   while (<FILE>) {
     chomp;
 
-    if ( $first_line ) { # in first line test on e, p, r, t
+    s/^[']/./;
+
+    if ( $first_line ) {
+      # when first line, test on comment with character set for grog args
+
       $first_line = 0; # end of first line
 
       if ( /^\.\\"\s*(.+)$/ ) {
@@ -167,12 +171,24 @@ sub process {
        if ( /e/ ) {
          $Groff{'eqn'}++;
        }
+       if ( /g/ ) {
+         $Groff{'grn'}++;
+       }
+       if ( /G/ ) {
+         $Groff{'grap'}++;
+       }
+       if ( /j/ ) {
+         $Groff{'chem'}++;
+       }
        if ( /p/ ) {
          $Groff{'pic'}++;
        }
-       if ( /r/ ) {
+       if ( /R/ ) {
          $Groff{'refer'}++;
        }
+       if ( /s/ ) {
+         $Groff{'soelim'}++;
+       }
        if ( /t/ ) {
          $Groff{'tbl'}++;
        }
@@ -396,14 +412,14 @@ sub version {
        $Groff{'grn'} || $Groff{'grap'} || $Groff{'refer'} ||
        $Groff{'chem'} ) {
     my $s = "-";
-    $s .= "s" if $Groff{'soelim'};
-    $s .= "R" if $Groff{'refer'};
+    $s .= "e" if $Groff{'eqn'};
+    $s .= "g" if $Groff{'grn'};
     $s .= "G" if $Groff{'grap'};
     $s .= "j" if $Groff{'chem'};
     $s .= "p" if $Groff{'pic'};
-    $s .= "g" if $Groff{'grn'};
+    $s .= "R" if $Groff{'refer'};
+    $s .= "s" if $Groff{'soelim'};
     $s .= "t" if $Groff{'tbl'};
-    $s .= "e" if $Groff{'eqn'};
     push(@Command, $s);
   }
 



reply via email to

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