[Po4a-commits] "po4a/lib/Locale/Po4a Man.pm,1.211,1.212"

Denis Barbier barbier-guest at alioth.debian.org
Mon Jul 19 21:36:16 UTC 2010


Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory alioth:/tmp/cvs-serv26784/lib/Locale/Po4a

Modified Files:
	Man.pm 
Log Message:
Add support for .TQ macro.

Patch by James Vega, thanks.


Index: Man.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Man.pm,v
retrieving revision 1.211
retrieving revision 1.212
diff -u -d -r1.211 -r1.212
--- Man.pm	19 Jul 2010 20:52:06 -0000	1.211
+++ Man.pm	19 Jul 2010 21:36:14 -0000	1.212
@@ -728,7 +728,7 @@
                 $insert_font = "\\f$font$insert_font";
                 $line = $l2;
                 $ref = $r2;
-            } elsif ($l2 =~ /^[.'][\t ]*(SH|TP|P|PP|LP)(?:[\t ]|\s*$)/) {
+            } elsif ($l2 =~ /^[.'][\t ]*(SH|TP|TQ|P|PP|LP)(?:[\t ]|\s*$)/) {
                 $line =~ s/^\.([BI])\s*$/$insert_font\\f$1/;
                 $self->SUPER::unshiftline($l2,$r2);
             } elsif ($l2 =~ /^([.'][\t ]*(?:IP)[\t ]+"?)(.*)$/) {
@@ -1051,7 +1051,7 @@
                     )?
                     [.']
                    )/\\&$1/mgx;
-    } elsif ($self->{type} =~ m/^(TP)$/) {
+    } elsif ($self->{type} =~ m/^(TP|TQ)$/) {
         # But it is also needed for some type (e.g. TP, if followed by a
         # font macro)
         # This regular expression is the same as above
@@ -1846,10 +1846,7 @@
 $macro{'RE'}=\&noarg;
 $macro{'RS'}=\&untranslated;
 
-#Indented Paragraph Macros
-#  .TP i    Begin  paragraph  with  hanging tag.  The tag is given on the next line,
-#           but its results are like those of the .IP command.
-$macro{'TP'}=sub {
+sub parse_tp_tq {
     my $self=shift;
     my ($line,$l2,$ref2);
     $line .= $_[0] if defined($_[0]);
@@ -1882,6 +1879,13 @@
     } else {
 	$self->pushline($self->t($l2, "wrap" => 0)."\n");
     }
+}
+
+#Indented Paragraph Macros
+#  .TP i    Begin  paragraph  with  hanging tag.  The tag is given on the next line,
+#           but its results are like those of the .IP command.
+$macro{'TP'}=sub {
+    parse_tp_tq(@_);
 
     # From info groff:
     # Note that neither font shape nor font size of the label [i.e. argument
@@ -1890,6 +1894,16 @@
     set_font("R");
 };
 
+# Indented Paragraph Macros
+# .TQ  Indicates continuation of the .TP labels that precede the indented
+#      paragraph.
+$macro{'TQ'}=sub {
+    warn "Macro $_[1] does not accept any argument\n"
+	if (defined ($_[2]));
+
+    parse_tp_tq(@_);
+};
+
 #   Indented Paragraph Macros
 #       .HP i    Begin paragraph with a hanging indent (the first line of  the  paragraph
 #                is  at  the  left margin of normal paragraphs, and the rest of the para-




More information about the Po4a-commits mailing list