Integrate #16254 from macperl;
[p5sagit/p5-mst-13.2.git] / lib / Pod / Man.pm
index 037f427..0f0eaab 100644 (file)
@@ -1,16 +1,16 @@
 # Pod::Man -- Convert POD data to formatted *roff input.
-# $Id: Man.pm,v 1.26 2001/11/15 09:02:06 eagle Exp $
+# $Id: Man.pm,v 1.32 2002/01/02 09:02:24 eagle Exp $
 #
-# Copyright 1999, 2000, 2001 by Russ Allbery <rra@stanford.edu>
+# Copyright 1999, 2000, 2001, 2002 by Russ Allbery <rra@stanford.edu>
 #
 # This program is free software; you may redistribute it and/or modify it
 # under the same terms as Perl itself.
 #
-# This module is intended to be a replacement for the pod2man script
-# distributed with versions of Perl prior to 5.6, and attempts to match its
-# output except for some specific circumstances where other decisions seemed
-# to produce better output.  It uses Pod::Parser and is designed to be easy to
-# subclass.
+# This module translates POD documentation into *roff markup using the man
+# macro set, and is intended for converting POD documents written as Unix
+# manual pages to manual pages that can be read by the man(1) command.  It is
+# a replacement for the pod2man command distributed with versions of Perl
+# prior to 5.6.
 #
 # Perl core hackers, please note that this module is also separately
 # maintained outside of the Perl core as part of the podlators.  Please send
@@ -23,7 +23,7 @@
 
 package Pod::Man;
 
-require 5.004;
+require 5.005;
 
 use Carp qw(carp croak);
 use Pod::ParseLink qw(parselink);
@@ -38,7 +38,7 @@ use vars qw(@ISA %ESCAPES $PREAMBLE $VERSION);
 # Don't use the CVS revision as the version, since this module is also in Perl
 # core and too many things could munge CVS magic revision strings.  This
 # number should ideally be the same as the CVS revision in podlators, however.
-$VERSION = 1.26;
+$VERSION = 1.32;
 
 
 ##############################################################################
@@ -70,7 +70,6 @@ $PREAMBLE = <<'----END OF PREAMBLE----';
 ..
 .de Ve \" End verbatim text
 .ft R
-
 .fi
 ..
 .\" Set up some character translations and predefined strings.  \*(-- will
@@ -324,7 +323,7 @@ sub initialize {
     # Extra stuff for page titles.
     $$self{center} = 'User Contributed Perl Documentation'
         unless defined $$self{center};
-    $$self{indent}  = 4 unless defined $$self{indent};
+    $$self{indent} = 4 unless defined $$self{indent};
 
     # We used to try first to get the version number from a local binary, but
     # we shouldn't need that any more.  Get the version from the running Perl.
@@ -363,12 +362,6 @@ sub initialize {
     $$self{LQUOTE} =~ s/\"/\"\"/;
     $$self{RQUOTE} =~ s/\"/\"\"/;
 
-    $$self{INDENT}    = 0;      # Current indentation level.
-    $$self{INDENTS}   = [];     # Stack of indentations.
-    $$self{INDEX}     = [];     # Index keys waiting to be printed.
-    $$self{ITEMS}     = 0;      # The number of consecutive =items.
-    $$self{NEWINDENT} = 0;      # Whether we've seen =over without =item.
-
     $self->SUPER::initialize;
 }
 
@@ -420,7 +413,7 @@ sub begin_pod {
                 splice (@dirs, 0, $cut);
                 shift @dirs if ($dirs[0] =~ /^site(_perl)?$/);
                 shift @dirs if ($dirs[0] =~ /^[\d.]+$/);
-                shift @dirs if ($dirs[0] =~ /^(.*-$^O|$^O-.*)$/);
+                shift @dirs if ($dirs[0] =~ /^(.*-$^O|$^O-.*|$^O)$/);
             }
             shift @dirs if $dirs[0] eq 'lib';
             splice (@dirs, 0, 2) if ($dirs[0] eq 'blib' && $dirs[1] eq 'lib');
@@ -470,12 +463,16 @@ $_
 .\\"
 .IX Title "$name $section"
 .TH $name $section "$$self{date}" "$$self{release}" "$$self{center}"
-.UC
 ----END OF HEADER----
 
     # Initialize a few per-file variables.
-    $$self{INDENT} = 0;
-    $$self{NEEDSPACE} = 0;
+    $$self{INDENT}    = 0;      # Current indentation level.
+    $$self{INDENTS}   = [];     # Stack of indentations.
+    $$self{INDEX}     = [];     # Index keys waiting to be printed.
+    $$self{IN_NAME}   = 0;      # Whether processing the NAME section.
+    $$self{ITEMS}     = 0;      # The number of consecutive =items.
+    $$self{SHIFTWAIT} = 0;      # Whether there is a shift waiting.
+    $$self{SHIFTS}    = [];     # Stack of .RS shifts.
 }
 
 
@@ -522,7 +519,7 @@ sub verbatim {
     s/^(\s*\S)/'\&' . $1/gme;
     $self->makespace;
     $self->output (".Vb $lines\n$_.Ve\n");
-    $$self{NEEDSPACE} = 0;
+    $$self{NEEDSPACE} = 1;
 }
 
 # Called for a regular text block.  Gets the paragraph, the line number, and a
@@ -544,27 +541,27 @@ sub textblock {
     # handle creation of the indent here.  Set WEIRDINDENT so that it will be
     # cleaned up on =back.
     $self->makespace;
-    if ($$self{NEWINDENT}) {
+    if ($$self{SHIFTWAIT}) {
         $self->output (".RS $$self{INDENT}\n");
-        $$self{WEIRDINDENT} = 1;
-        $$self{NEWINDENT} = 0;
+        push (@{ $$self{SHIFTS} }, $$self{INDENT});
+        $$self{SHIFTWAIT} = 0;
     }
     $self->output (protect $self->textmapfonts ($text));
     $self->outindex;
     $$self{NEEDSPACE} = 1;
 }
 
-# Called for an interior sequence.  Takes a Pod::InteriorSequence object and
+# Called for a formatting code.  Takes a Pod::InteriorSequence object and
 # returns a reference to a scalar.  This scalar is the final formatted text.
-# It's returned as a reference so that other interior sequences above us know
-# that the text has already been processed.
+# It's returned as a reference to an array so that other formatting codes
+# above us know that the text has already been processed.
 sub sequence {
     my ($self, $seq) = @_;
     my $command = $seq->cmd_name;
 
     # We have to defer processing of the inside of an L<> formatting code.  If
-    # this sequence is nested inside an L<> sequence, return the literal raw
-    # text of it.
+    # this code is nested inside an L<> code, return the literal raw text of
+    # it.
     my $parent = $seq->nested;
     while (defined $parent) {
         return $seq->raw_text if ($parent->cmd_name eq 'L');
@@ -572,46 +569,37 @@ sub sequence {
     }
 
     # Zero-width characters.
-    if ($command eq 'Z') {
-        # Workaround to generate a blessable reference, needed by 5.005.
-        my $tmp = '\&';
-        return bless \ "$tmp", 'Pod::Man::String';
-    }
+    return [ '\&' ] if ($command eq 'Z');
 
     # C<>, L<>, X<>, and E<> don't apply guesswork to their contents.  C<>
     # needs some additional special handling.
     my $literal = ($command =~ /^[CELX]$/);
-    $literal++ if $command eq 'C';
-    local $_ = $self->collapse ($seq->parse_tree, $literal);
+    local $_ = $self->collapse ($seq->parse_tree, $literal, $command eq 'C');
 
     # Handle E<> escapes.  Numeric escapes that match one of the supported ISO
     # 8859-1 characters don't work at present.
     if ($command eq 'E') {
         if (/^\d+$/) {
-            return bless \ chr ($_), 'Pod::Man::String';
+            return [ chr ($_) ];
         } elsif (exists $ESCAPES{$_}) {
-            return bless \ "$ESCAPES{$_}", 'Pod::Man::String';
+            return [ $ESCAPES{$_} ];
         } else {
             my ($file, $line) = $seq->file_line;
             warn "$file:$line: Unknown escape E<$_>\n";
-            return bless \ "E<$_>", 'Pod::Man::String';
+            return [ "E<$_>" ];
         }
     }
 
-    # For all the other sequences, empty content produces no output.
+    # For all the other codes, empty content produces no output.
     return '' if $_ eq '';
 
-    # Handle formatting sequences.
+    # Handle simple formatting codes.
     if ($command eq 'B') {
-        return bless \ ('\f(BS' . $_ . '\f(BE'), 'Pod::Man::String';
-    } elsif ($command eq 'F') {
-        return bless \ ('\f(IS' . $_ . '\f(IE'), 'Pod::Man::String';
-    } elsif ($command eq 'I') {
-        return bless \ ('\f(IS' . $_ . '\f(IE'), 'Pod::Man::String';
+        return [ '\f(BS' . $_ . '\f(BE' ];
+    } elsif ($command eq 'F' || $command eq 'I') {
+        return [ '\f(IS' . $_ . '\f(IE' ];
     } elsif ($command eq 'C') {
-        # A bug in lvalue subs in 5.6 requires the temporary variable.
-        my $tmp = $self->quote_literal ($_);
-        return bless \ "$tmp", 'Pod::Man::String';
+        return [ $self->quote_literal ($_) ];
     }
 
     # Handle links.
@@ -621,21 +609,24 @@ sub sequence {
         my ($file, $line) = $seq->file_line;
         $text = $self->parse ($text, $line);
         $text = '<' . $text . '>' if $type eq 'url';
-        return bless \ "$text", 'Pod::Man::String';
+        return [ $text ];
     }
 
     # Whitespace protection replaces whitespace with "\ ".
     if ($command eq 'S') {
         s/\s+/\\ /g;
-        return bless \ "$_", 'Pod::Man::String';
+        return [ $_ ];
     }
 
     # Add an index entry to the list of ones waiting to be output.
-    if ($command eq 'X') { push (@{ $$self{INDEX} }, $_); return '' }
+    if ($command eq 'X') {
+        push (@{ $$self{INDEX} }, $_);
+        return '';
+    }
 
     # Anything else is unknown.
     my ($file, $line) = $seq->file_line;
-    warn "$file:$line: Unknown sequence $command<$_>\n";
+    warn "$file:$line: Unknown formatting code $command<$_>\n";
 }
 
 
@@ -647,9 +638,12 @@ sub sequence {
 
 # First level heading.  We can't output .IX in the NAME section due to a bug
 # in some versions of catman, so don't output a .IX for that section.  .SH
-# already uses small caps, so remove any E<> sequences that would cause them.
+# already uses small caps, so remove \s1 and \s-1.  Maintain IN_NAME as
+# appropriate, but don't leave it set while calling parse() so as to not
+# override guesswork on section headings after NAME.
 sub cmd_head1 {
     my $self = shift;
+    $$self{IN_NAME} = 0;
     local $_ = $self->parse (@_);
     s/\s+$//;
     s/\\s-?\d//g;
@@ -661,6 +655,7 @@ sub cmd_head1 {
     $self->output ($self->switchquotes ('.SH', $self->mapfonts ($_)));
     $self->outindex (($_ eq 'NAME') ? () : ('Header', $_));
     $$self{NEEDSPACE} = 0;
+    $$self{IN_NAME} = ($_ eq 'NAME');
 }
 
 # Second level heading.
@@ -689,7 +684,7 @@ sub cmd_head3 {
         $self->output (".PD\n");
     }
     $self->makespace;
-    $self->output ($self->switchquotes ('.I', $self->mapfonts ($_)));
+    $self->output ($self->textmapfonts ('\f(IS' . $_ . '\f(IE') . "\n");
     $self->outindex ('Subsection', $_);
     $$self{NEEDSPACE} = 1;
 }
@@ -716,12 +711,13 @@ sub cmd_over {
     my $self = shift;
     local $_ = shift;
     unless (/^[-+]?\d+\s+$/) { $_ = $$self{indent} }
-    if (@{ $$self{INDENTS} } > 0 && !$$self{WEIRDINDENT}) {
+    if (@{ $$self{SHIFTS} } < @{ $$self{INDENTS} }) {
         $self->output (".RS $$self{INDENT}\n");
+        push (@{ $$self{SHIFTS} }, $$self{INDENT});
     }
     push (@{ $$self{INDENTS} }, $$self{INDENT});
     $$self{INDENT} = ($_ + 0);
-    $$self{NEWINDENT} = 1;
+    $$self{SHIFTWAIT} = 1;
 }
 
 # End a list.  If we've closed an embedded indent, we've mangled the hanging
@@ -736,17 +732,16 @@ sub cmd_back {
         warn "$file:$line: Unmatched =back\n";
         $$self{INDENT} = 0;
     }
-    if ($$self{WEIRDINDENT}) {
+    if (@{ $$self{SHIFTS} } > @{ $$self{INDENTS} }) {
         $self->output (".RE\n");
-        $$self{WEIRDINDENT} = 0;
+        pop @{ $$self{SHIFTS} };
     }
     if (@{ $$self{INDENTS} } > 0) {
         $self->output (".RE\n");
         $self->output (".RS $$self{INDENT}\n");
-        $$self{WEIRDINDENT} = 1;
     }
     $$self{NEEDSPACE} = 1;
-    $$self{NEWINDENT} = 0;
+    $$self{SHIFTWAIT} = 0;
 }
 
 # An individual list item.  Emit an index entry for anything that's
@@ -766,9 +761,9 @@ sub cmd_item {
     }
     $_ = '*' unless $_;
     s/^\*(\s|\Z)/\\\(bu$1/;
-    if ($$self{WEIRDINDENT}) {
+    if (@{ $$self{SHIFTS} } == @{ $$self{INDENTS} }) {
         $self->output (".RE\n");
-        $$self{WEIRDINDENT} = 0;
+        pop @{ $$self{SHIFTS} };
     }
     $_ = $self->textmapfonts ($_);
     $self->output (".PD 0\n") if ($$self{ITEMS} == 1);
@@ -776,7 +771,7 @@ sub cmd_item {
     $self->outindex ($index ? ('Item', $index) : ());
     $$self{NEEDSPACE} = 0;
     $$self{ITEMS}++;
-    $$self{NEWINDENT} = 0;
+    $$self{SHIFTWAIT} = 0;
 }
 
 # Begin a block for a particular translator.  Setting VERBATIM triggers
@@ -881,36 +876,46 @@ sub parse {
                          -expand_ptree => 'collapse' }, @_);
 }
 
-# Takes a parse tree and a flag saying whether or not to treat it as literal
-# text (not call guesswork on it), and returns the concatenation of all of the
-# text strings in that parse tree.  If the literal flag isn't true,
-# guesswork() will be called on all plain scalars in the parse tree.
-# Otherwise, just escape backslashes in the normal case.  If collapse is being
-# called on a C<> sequence, literal is set to 2, and we do some additional
-# cleanup.  Assumes that everything in the parse tree is either a scalar or a
-# reference to a scalar.
+# Takes a parse tree, a flag saying whether or not to treat it as literal text
+# (not call guesswork on it), and a flag saying whether or not to clean some
+# things up for *roff, and returns the concatenation of all of the text
+# strings in that parse tree.  If the literal flag isn't true, guesswork()
+# will be called on all plain scalars in the parse tree.  Otherwise, if
+# collapse is being called on a C<> code, $cleanup should be set to true and
+# some additional cleanup will be done.  Assumes that everything in the parse
+# tree is either a scalar or a reference to a scalar.
 sub collapse {
-    my ($self, $ptree, $literal) = @_;
-    if ($literal) {
-        return join ('', map {
-            if (ref $_) {
-                $$_;
-            } else {
-                s/\\/\\e/g   if $literal > 1;
-                s/-/\\-/g    if $literal > 1;
-                s/__/_\\|_/g if $literal > 1;
-                $_;
-            }
-        } $ptree->children);
-    } else {
-        return join ('', map {
-            ref ($_) ? $$_ : $self->guesswork ($_)
-        } $ptree->children);
+    my ($self, $ptree, $literal, $cleanup) = @_;
+
+    # If we're processing the NAME section, don't do normal guesswork.  This
+    # is because NAME lines are often extracted by utilities like catman that
+    # require plain text and don't understand *roff markup.  We still need to
+    # escape backslashes and hyphens for *roff (and catman expects \- instead
+    # of -).
+    if ($$self{IN_NAME}) {
+        $literal = 1;
+        $cleanup = 1;
     }
+
+    # Do the collapse of the parse tree as described above.
+    return join ('', map {
+        if (ref $_) {
+            join ('', @$_);
+        } elsif ($literal) {
+            if ($cleanup) {
+                s/\\/\\e/g;
+                s/-/\\-/g;
+                s/__/_\\|_/g;
+            }
+            $_;
+        } else {
+            $self->guesswork ($_);
+        }
+    } $ptree->children);
 }
 
 # Takes a text block to perform guesswork on; this is guaranteed not to
-# contain any interior sequences.  Returns the text block with remapping done.
+# contain any formatting codes.  Returns the text block with remapping done.
 sub guesswork {
     my $self = shift;
     local $_ = shift;
@@ -1039,19 +1044,20 @@ sub outindex {
     my @entries = map { split m%\s*/\s*% } @{ $$self{INDEX} };
     return unless ($section || @entries);
     $$self{INDEX} = [];
-    my $output;
+    my @output;
     if (@entries) {
-        $output = '.IX Xref "'
-            . join (' ', map { s/\"/\"\"/; $_ } @entries)
-            . '"' . "\n";
+        push (@output, [ 'Xref', join (' ', @entries) ]);
     }
     if ($section) {
-        $index =~ s/\"/\"\"/;
         $index =~ s/\\-/-/g;
         $index =~ s/\\(?:s-?\d|.\(..|.)//g;
-        $output .= ".IX $section " . '"' . $index . '"' . "\n";
+        push (@output, [ $section, $index ]);
+    }
+    for (@output) {
+        my ($type, $entry) = @$_;
+        $entry =~ s/\"/\"\"/g;
+        $self->output (".IX $type " . '"' . $entry . '"' . "\n");
     }
-    $self->output ($output);
 }
 
 # Output text to the output device.
@@ -1073,12 +1079,14 @@ sub switchquotes {
 
     # We also have to deal with \*C` and \*C', which are used to add the
     # quotes around C<> text, since they may expand to " and if they do this
-    # confuses the .SH macros and the like no end.  Expand them ourselves.  If
-    # $extra is set, we're dealing with =item, which in most nroff macro sets
-    # requires an extra level of quoting of double quotes because it passes
-    # the argument off to .TP.
+    # confuses the .SH macros and the like no end.  Expand them ourselves.
+    # Also separate troff from nroff if there are any fixed-width fonts in use
+    # to work around problems with Solaris nroff.
     my $c_is_quote = ($$self{LQUOTE} =~ /\"/) || ($$self{RQUOTE} =~ /\"/);
-    if (/\"/ || /\\f\(CW/) {
+    my $fixedpat = join ('|', @{ $$self{FONTS} }{'100', '101', '110', '111'});
+    $fixedpat =~ s/\\/\\\\/g;
+    $fixedpat =~ s/\(/\\\(/g;
+    if (/\"/ || /$fixedpat/) {
         s/\"/\"\"/g;
         my $nroff = $_;
         my $troff = $_;
@@ -1094,10 +1102,11 @@ sub switchquotes {
         # Work around the Solaris nroff bug where \f(CW\fP leaves the font set
         # to Roman rather than the actual previous font when used in headings.
         # troff output may still be broken, but at least we can fix nroff by
-        # just stripping out the font changes since fixed-width fonts don't
-        # mean anything for nroff.  While we're at it, also remove the font
-        # changes for nroff in =item tags, since they're unnecessary.
-        $nroff =~ s/\\f\(CW(.*)\\f[PR]/$1/g;
+        # just switching the font changes to the non-fixed versions.
+        $nroff =~ s/\Q$$self{FONTS}{100}\E(.*)\\f[PR]/$1/g;
+        $nroff =~ s/\Q$$self{FONTS}{101}\E(.*)\\f([PR])/\\fI$1\\f$2/g;
+        $nroff =~ s/\Q$$self{FONTS}{110}\E(.*)\\f([PR])/\\fB$1\\f$2/g;
+        $nroff =~ s/\Q$$self{FONTS}{111}\E(.*)\\f([PR])/\\f\(BI$1\\f$2/g;
 
         # Now finally output the command.  Only bother with .ie if the nroff
         # and troff output isn't the same.
@@ -1114,36 +1123,6 @@ sub switchquotes {
 
 __END__
 
-.\" These are some extra bits of roff that I don't want to lose track of but
-.\" that have been removed from the preamble to make it a bit shorter since
-.\" they're not currently being used.  They're accents and special characters
-.\" we don't currently have escapes for.
-.if n \{\
-.    ds ? ?
-.    ds ! !
-.    ds q
-.\}
-.if t \{\
-.    ds ? \s-2c\h'-\w'c'u*7/10'\u\h'\*(#H'\zi\d\s+2\h'\w'c'u*8/10'
-.    ds ! \s-2\(or\s+2\h'-\w'\(or'u'\v'-.8m'.\v'.8m'
-.    ds q o\h'-\w'o'u*8/10'\s-4\v'.4m'\z\(*i\v'-.4m'\s+4\h'\w'o'u*8/10'
-.\}
-.ds v \\k:\h'-(\\n(.wu*9/10-\*(#H)'\v'-\*(#V'\*(#[\s-4v\s0\v'\*(#V'\h'|\\n:u'\*(#]
-.ds _ \\k:\h'-(\\n(.wu*9/10-\*(#H+(\*(#F*2/3))'\v'-.4m'\z\(hy\v'.4m'\h'|\\n:u'
-.ds . \\k:\h'-(\\n(.wu*8/10)'\v'\*(#V*4/10'\z.\v'-\*(#V*4/10'\h'|\\n:u'
-.ds 3 \*(#[\v'.2m'\s-2\&3\s0\v'-.2m'\*(#]
-.ds oe o\h'-(\w'o'u*4/10)'e
-.ds Oe O\h'-(\w'O'u*4/10)'E
-.if \n(.H>23 .if \n(.V>19 \
-\{\
-.    ds v \h'-1'\o'\(aa\(ga'
-.    ds _ \h'-1'^
-.    ds . \h'-1'.
-.    ds 3 3
-.    ds oe oe
-.    ds Oe OE
-.\}
-
 ##############################################################################
 # Documentation
 ##############################################################################
@@ -1174,7 +1153,7 @@ also be used directly.
 
 As a derived class from Pod::Parser, Pod::Man supports the same methods and
 interfaces.  See L<Pod::Parser> for all the details; briefly, one creates a
-new parser with C<Pod::Man-E<gt>new()> and then calls either
+new parser with C<< Pod::Man->new() >> and then calls either
 parse_from_filehandle() or parse_from_file().
 
 new() can take options, in the form of key/value pairs that control the
@@ -1199,10 +1178,10 @@ func(), func(3), and simple variable references like $foo or @bar so you
 don't have to use code escapes for them; complex expressions like
 C<$fred{'stuff'}> will still need to be escaped, though.  It also translates
 dashes that aren't used as hyphens into en dashes, makes long dashes--like
-this--into proper em dashes, fixes "paired quotes," makes C++ and PI look
-right, puts a little space between double underbars, makes ALLCAPS a teeny
-bit smaller in B<troff>, and escapes stuff that *roff treats as special so
-that you don't have to.
+this--into proper em dashes, fixes "paired quotes," makes C++ look right,
+puts a little space between double underbars, makes ALLCAPS a teeny bit
+smaller in B<troff>, and escapes stuff that *roff treats as special so that
+you don't have to.
 
 The recognized options to new() are as follows.  All options take a single
 argument.
@@ -1310,9 +1289,9 @@ versions of B<nroff> and B<troff> don't either).
 
 =item Invalid link %s
 
-(W) The POD source contained a C<LE<lt>E<gt>> sequence that Pod::Man was
-unable to parse.  You should never see this error message; it probably
-indicates a bug in Pod::Man.
+(W) The POD source contained a C<LE<lt>E<gt>> formatting code that
+Pod::Man was unable to parse.  You should never see this error message; it
+probably indicates a bug in Pod::Man.
 
 =item Invalid quote specification "%s"
 
@@ -1329,9 +1308,9 @@ the form C<=command args>) that Pod::Man didn't know about.  It was ignored.
 (W) The POD source contained an C<EE<lt>E<gt>> escape that Pod::Man didn't
 know about.  C<EE<lt>%sE<gt>> was printed verbatim in the output.
 
-=item %s:%d: Unknown sequence %s
+=item %s:%d: Unknown formatting code %s
 
-(W) The POD source contained a non-standard interior sequence (something of
+(W) The POD source contained a non-standard formatting code (something of
 the form C<XE<lt>E<gt>>) that Pod::Man didn't know about.  It was ignored.
 
 =item %s:%d: Unmatched =back
@@ -1343,22 +1322,24 @@ C<=over> command.
 
 =head1 BUGS
 
-The lint-like features and strict POD format checking done by B<pod2man> are
-not yet implemented and should be, along with the corresponding C<lax>
-option.
+Eight-bit input data isn't handled at all well at present.  The correct
+approach would be to map EE<lt>E<gt> escapes to the appropriate UTF-8
+characters and then do a translation pass on the output according to the
+user-specified output character set.  Unfortunately, we can't send eight-bit
+data directly to the output unless the user says this is okay, since some
+vendor *roff implementations can't handle eight-bit data.  If the *roff
+implementation can, however, that's far superior to the current hacked
+characters that only work under troff.
+
+There is currently no way to turn off the guesswork that tries to format
+unmarked text appropriately, and sometimes it isn't wanted (particularly
+when using POD to document something other than Perl).
 
 The NAME section should be recognized specially and index entries emitted
 for everything in that section.  This would have to be deferred until the
 next section, since extraneous things in NAME tends to confuse various man
 page processors.
 
-The handling of hyphens and em dashes is somewhat fragile, and one may get
-the wrong one under some circumstances.  This should only matter for
-B<troff> output.
-
-When and whether to use small caps is somewhat tricky, and Pod::Man doesn't
-necessarily get it right.
-
 Pod::Man doesn't handle font names longer than two characters.  Neither do
 most B<troff> implementations, but GNU troff does as an extension.  It would
 be nice to support as an option for those who want to use it.
@@ -1370,6 +1351,15 @@ output if needed, perhaps on the fly as the characters are used.
 
 Pod::Man is excessively slow.
 
+=head1 CAVEATS
+
+The handling of hyphens and em dashes is somewhat fragile, and one may get
+the wrong one under some circumstances.  This should only matter for
+B<troff> output.
+
+When and whether to use small caps is somewhat tricky, and Pod::Man doesn't
+necessarily get it right.
+
 =head1 SEE ALSO
 
 L<Pod::Parser>, L<perlpod(1)>, L<pod2man(1)>, L<nroff(1)>, L<troff(1)>,
@@ -1393,7 +1383,7 @@ B<pod2man> by Tom Christiansen <tchrist@mox.perl.com>.
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright 1999, 2000, 2001 by Russ Allbery <rra@stanford.edu>.
+Copyright 1999, 2000, 2001, 2002 by Russ Allbery <rra@stanford.edu>.
 
 This program is free software; you may redistribute it and/or modify it
 under the same terms as Perl itself.