Package: po4a Version: 0.39-1 Severity: wishlist Tags: patch >From groff_man(7), “.TQ” is used to continue the label list of a preceding “.TP” before beginning the indented paragraph. Attached patch takes the approach of treating TQ like TP except without resetting the font (since that's handled in the parsing of TP).
It seems to work, but I don't have a lot of experience with po4a. I didn't see any regressions in the testsuite, though. -- System Information: Debian Release: squeeze/sid APT prefers unstable APT policy: (500, 'unstable'), (100, 'experimental') Architecture: i386 (i686) Kernel: Linux 2.6.32-5-686 (SMP w/2 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages po4a depends on: ii gettext 0.18.1.1-1 GNU Internationalization utilities pn libsgmls-perl <none> (no description available) ii perl 5.10.1-13 Larry Wall's Practical Extraction ii perl-modules 5.10.1-13 Core Perl modules pn sp <none> (no description available) Versions of packages po4a recommends: ii liblocale-gettext-perl 1.05-6 Using libc functions for internati ii libterm-readkey-perl 2.30-4 A perl module for simple terminal ii libtext-wrapi18n-perl 0.06-7 internationalized substitute of Te po4a suggests no packages.
Index: po4a/lib/Locale/Po4a/Man.pm =================================================================== RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Man.pm,v retrieving revision 1.210 diff -u -r1.210 Man.pm --- po4a/lib/Locale/Po4a/Man.pm 17 Apr 2010 08:45:14 -0000 1.210 +++ po4a/lib/Locale/Po4a/Man.pm 13 Jul 2010 01:49:16 -0000 @@ -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-