groff-commit
[Top][All Lists]
Advanced

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

[groff] 01/01: grog: add -T in all output, including -Tps for default.


From: Bernd Warken
Subject: [groff] 01/01: grog: add -T in all output, including -Tps for default.
Date: Thu, 30 Jul 2015 08:01:05 +0000

bwarken pushed a commit to branch master
in repository groff.

commit 01896f04028f1962e69314257dd542c6539a0e73
Author: Bernd Warken <address@hidden>
Date:   Thu Jul 30 10:00:07 2015 +0200

    grog: add -T in all output, including -Tps for default.
---
 ChangeLog              |    7 ++++++
 src/roff/grog/grog.man |   19 +++++++++++++---
 src/roff/grog/subs.pl  |   55 ++++++++++++++++++++---------------------------
 3 files changed, 45 insertions(+), 36 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 108c942..810106f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-07-29  Bernd Warken  <address@hidden>
+
+       * src/roff/grog/subs.pl: Add -T for all `grog' output, also using
+       -Tps when no option -T is given in the arguments.
+
+       * src/roff/grog/grog.man: Add information about -T output.
+
 2015-07-23  Bernd Warken  <address@hidden>
 
        * man/groff.man: Add last update.  Add link on Wikipedia on groff.
diff --git a/src/roff/grog/grog.man b/src/roff/grog/grog.man
index 4609155..386d28b 100644
--- a/src/roff/grog/grog.man
+++ b/src/roff/grog/grog.man
@@ -12,7 +12,9 @@ grog \(em guess options for a following groff command
 .\" --------------------------------------------------------------------
 .
 .de co
-Copyright \(co 1989-2014 Free Software Foundation, Inc.
+Copyright \(co 1989-2015 Free Software Foundation, Inc.
+
+Last update: 29 Jul 2015
 
 This file is part of grog, which is part of groff, a free software
 project.  You can redistribute it and/or modify it under the terms of
@@ -64,10 +66,12 @@ Bernd Warken
 .
 .SY grog
 .OP \-C
+.OP \-T device
 .OP \-\-run
 .OP \-\-warnings
 .OP \-\-ligatures
-.OP \& "\%groff\-option \*(EL"
+.OP \& "\%groff\-option no arg"
+.OP \& "\%groff\-option with arg \*(EL"
 .OP \-\-
 .OP \& "\%filespec \*(EL"
 .YS
@@ -89,8 +93,12 @@ options are needed to perform the input with the
 .B groff
 program.
 .
+A suitable device is now always written as
+.BI -T device
+including the groff default as
+.BR "-T ps" .
+.
 .
-.RS
 .P
 The corresponding
 .B groff
@@ -102,7 +110,10 @@ the generated line is output into standard error and the 
generated
 .B groff
 command is run on the
 .IR "standard output" .
-.RE
+.
+.BR groffer (@MAN1EXT@)
+relies on a perfectly running
+.BR groff (@MAN1EXT@).
 .
 .
 .\" --------------------------------------------------------------------
diff --git a/src/roff/grog/subs.pl b/src/roff/grog/subs.pl
index 06121b8..c2a5aee 100644
--- a/src/roff/grog/subs.pl
+++ b/src/roff/grog/subs.pl
@@ -12,7 +12,7 @@
 # The macros for identifying the devices were taken from Ralph
 # Corderoy's `grog.sh' of 2006.
 
-# Last update: 19 Jul 2015
+# Last update: 29 Jul 2015
 
 # This file is part of `grog', which is part of `groff'.
 
@@ -58,7 +58,8 @@ my $groff_opts =
 
 my @Command = ();              # stores the final output
 my @Mparams = ();              # stores the options `-m*'
-my @devices = ();
+my @devices = ();              # stores -T
+
 my $do_run = 0;                        # run generated `groff' command
 my $pdf_with_ligatures = 0;    # `-P-y -PU' for `pdf' device
 my $with_warnings = 0;
@@ -901,42 +902,32 @@ my $correct_tmac = '';
 sub make_groff_device {
   # globals: @devices
 
-  # default device is empty, i.e. it is `ps' when without `-T'
-  my $device = '';
+  # default device is `ps' when without `-T'
+  my $device;
+  push @devices, 'ps' unless ( @devices );
 
+###### make_groff_device()
   for my $d ( @devices ) {
-    if ( $d =~                 # suitable devices
-        /^(
-           dvi|
-           html|
-           xhtml|
-           lbp|
-           lj4|
-           ps|
-           pdf|
-           ascii|
-           cp1047|
-           latin1|
-           utf8
-         )$/x ) {
+    if ( $d =~ /^(             # suitable devices
+                 dvi|
+                 html|
+                 xhtml|
+                 lbp|
+                 lj4|
+                 ps|
+                 pdf|
+                 ascii|
+                 cp1047|
+                 latin1|
+                 utf8
+               )$/x ) {
 ###### make_groff_device()
-      if ( $device ) {
-       next if ( $device eq $d );
-       print STDERR __FILE__ . ' ' .  __LINE__ . ': ' .
-         'several different devices given: ' .
-           $device . ' and ' .$d;
-       $device = $d;   # the last provided device is taken
-       next;
-      } else { # empty $device
-       $device = $d;
-       next;
-      }
-    } else {           # not suitable device
-      print STDERR __FILE__ . ' ' .  __LINE__ . ': ' .
-       'not a suitable device for groff: ' . $d;
+      $device = $d;
+    } else {
       next;
     }
 
+
     if ( $device ) {
       push @Command, '-T';
       push @Command, $device;



reply via email to

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