develooper Front page | perl.perl5.porters | Postings from March 2000

[PATCH-5.6RC2] podlators update patches

From:
Russ Allbery
Date:
March 16, 2000 17:10
Subject:
[PATCH-5.6RC2] podlators update patches
Message ID:
ylvh2mqu57.fsf@windlord.stanford.edu
This synchronizes the current versions in Perl 5.6 RC2 with the podlators
1.00 release.  This includes the following changes:

2000-03-16  Russ Allbery  <rra@stanford.edu>

        * lib/Pod/Text.pm: Use a static version number, add the remaining
        ISO 8859-1 HTML entities (from Tim Jenness).

        * lib/Pod/Man.pm (cmd_item): Replace embedded newlines in titles
        with spaces.

        * scripts/pod2man.PL: Hide '-' arguments from Getopt::Long so that
        Pod::Parser will interpret them as STDIN or STDOUT.  Remove
        needless use vars.
        * scripts/pod2text.PL: Likewise.

        * scripts/pod2text.PL: Don't default to Pod::Text::Termcap even if
        STDOUT is a tty until it works right on Windows, VMS, etc.

        * scripts/pod2man.PL: Change Getopt::Long config from bundling to
        bundling_override so that options like -center work for backwards
        compatibility.

2000-03-07  Russ Allbery  <rra@stanford.edu>

        * scripts/pod2man.PL: Change pod2txt to pod2man in SYNOPSIS.

2000-03-06  Russ Allbery  <rra@stanford.edu>

        * scripts/pod2man.PL: Changed "stati" to "statuses."


--- perl-5.6.0-RC2/lib/Pod/Man.pm.orig	Tue Mar 14 12:04:00 2000
+++ perl-5.6.0-RC2/lib/Pod/Man.pm	Thu Mar 16 17:05:33 2000
@@ -1,5 +1,5 @@
 # Pod::Man -- Convert POD data to formatted *roff input.
-# $Id: Man.pm,v 1.0 2000/03/06 10:16:31 eagle Exp $
+# $Id: Man.pm,v 1.1 2000/03/16 22:00:36 eagle Exp $
 #
 # Copyright 1999, 2000 by Russ Allbery <rra@stanford.edu>
 #
@@ -38,7 +38,7 @@
 # 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.00;
+$VERSION = 1.01;
 
 
 ############################################################################
@@ -669,11 +669,14 @@
 # An individual list item.  Emit an index entry for anything that's
 # interesting, but don't emit index entries for things like bullets and
 # numbers.  rofficate bullets too while we're at it (so for nice output, use
-# * for your lists rather than o or . or - or some other thing).
+# * for your lists rather than o or . or - or some other thing).  Newlines
+# in an item title are turned into spaces since *roff can't handle them
+# embedded.
 sub cmd_item {
     my $self = shift;
     local $_ = $self->parse (@_);
     s/\s+$//;
+    s/\s*\n\s*/ /g;
     my $index;
     if (/\w/ && !/^\w[.\)]\s*$/) {
         $index = $_;
--- perl-5.6.0-RC2/pod/pod2man.PL.orig	Thu Oct  7 21:56:19 1999
+++ perl-5.6.0-RC2/pod/pod2man.PL	Thu Mar 16 17:05:17 2000
@@ -36,14 +36,12 @@
 print OUT <<'!NO!SUBS!';
 
 # pod2man -- Convert POD data to formatted *roff input.
+# $Id: pod2man.PL,v 1.2 2000/03/16 21:08:23 eagle Exp $
 #
-# Copyright 1999 by Russ Allbery <rra@stanford.edu>
+# Copyright 1999, 2000 by Russ Allbery <rra@stanford.edu>
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the same terms as Perl itself.
-#
-# The driver script for Pod::Man.  This script is expected to eventually
-# replace pod2man in the standard Perl distribution.
 
 require 5.004;
 
@@ -52,12 +50,17 @@
 use Pod::Usage qw(pod2usage);
 
 use strict;
-use vars;
+
+# Insert -- into @ARGV before any single dash argument to hide it from
+# Getopt::Long; we want to interpret it as meaning stdin (which Pod::Parser
+# does correctly).
+my $stdin;
+@ARGV = map { $_ eq '-' && !$stdin++ ? ('--', $_) : $_ } @ARGV;
 
 # Parse our options, trying to retain backwards compatibility with pod2man
 # but allowing short forms as well.  --lax is currently ignored.
 my %options;
-Getopt::Long::config ('bundling');
+Getopt::Long::config ('bundling_override');
 GetOptions (\%options, 'section|s=s', 'release|r=s', 'center|c=s',
             'date|d=s', 'fixed=s', 'fixedbold=s', 'fixeditalic=s',
             'fixedbolditalic=s', 'official|o', 'lax|l', 'help|h') or exit 1;
@@ -80,13 +83,13 @@
 
 =head1 SYNOPSIS
 
-pod2txt [B<--section>=I<manext>] [B<--release>=I<version>]
+pod2man [B<--section>=I<manext>] [B<--release>=I<version>]
 [B<--center>=I<string>] [B<--date>=I<string>] [B<--fixed>=I<font>]
 [B<--fixedbold>=I<font>] [B<--fixeditalic>=I<font>]
 [B<--fixedbolditalic>=I<font>] [B<--official>] [B<--lax>] [I<input>
 [I<output>]]
 
-pod2txt B<--help>
+pod2man B<--help>
 
 =head1 DESCRIPTION
 
@@ -320,11 +323,11 @@
 
 =item ERRORS
 
-Exceptions, error return codes, exit stati, and errno settings.  Typically
-used for function documentation; program documentation uses DIAGNOSTICS
-instead.  The general rule of thumb is that errors printed to STDOUT or
-STDERR and intended for the end user are documented in DIAGNOSTICS while
-errors passed internal to the calling program and intended for other
+Exceptions, error return codes, exit statuses, and errno settings.
+Typically used for function documentation; program documentation uses
+DIAGNOSTICS instead.  The general rule of thumb is that errors printed to
+STDOUT or STDERR and intended for the end user are documented in DIAGNOSTICS
+while errors passed internal to the calling program and intended for other
 programmers are documented in ERRORS.  When documenting a function that sets
 errno, a full list of the possible errno values should be given here.
 
@@ -463,6 +466,7 @@
 
 =cut
 !NO!SUBS!
+#'# (cperl-mode)
 
 close OUT or die "Can't close $file: $!";
 chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
--- perl-5.6.0-RC2/pod/pod2text.PL.orig	Fri Oct  1 23:32:32 1999
+++ perl-5.6.0-RC2/pod/pod2text.PL	Thu Mar 16 17:05:20 2000
@@ -37,7 +37,7 @@
 
 # pod2text -- Convert POD data to formatted ASCII text.
 #
-# Copyright 1999 by Russ Allbery <rra@stanford.edu>
+# Copyright 1999, 2000 by Russ Allbery <rra@stanford.edu>
 #
 # This program is free software; you can redistribute it and/or modify it
 # under the same terms as Perl itself.
@@ -52,7 +52,6 @@
 use Pod::Usage qw(pod2usage);
 
 use strict;
-use vars qw($ID);
 
 # Take an initial pass through our options, looking for one of the form
 # -<number>.  We turn that into -w <number> for compatibility with the
@@ -64,14 +63,19 @@
     }
 }
 
+# Insert -- into @ARGV before any single dash argument to hide it from
+# Getopt::Long; we want to interpret it as meaning stdin (which Pod::Parser
+# does correctly).
+my $stdin;
+@ARGV = map { $_ eq '-' && !$stdin++ ? ('--', $_) : $_ } @ARGV;
+
 # Parse our options.  Use the same names as Pod::Text for simplicity, and
 # default to sentence boundaries turned off for compatibility.
 my %options;
-$options{termcap} = -t STDOUT;
 $options{sentence} = 0;
 Getopt::Long::config ('bundling');
 GetOptions (\%options, 'alt|a', 'color|c', 'help|h', 'indent|i=i',
-            'loose|l', 'sentence|s', 'termcap|t!', 'width|w=i') or exit 1;
+            'loose|l', 'sentence|s', 'termcap|t', 'width|w=i') or exit 1;
 pod2usage (1) if $options{help};
 
 # Figure out what formatter we're going to use.  -c overrides -t.
@@ -114,10 +118,6 @@
 is the file to which to write the formatted output.  If I<output> isn't
 given, the formatted output is written to STDOUT.
 
-B<pod2text> defaults to trying to use Pod::Text::Termcap if STDOUT is a tty.
-To explicitly say not to attempt termcap escape sequences, use
-B<--notermcap>.
-
 =head1 OPTIONS
 
 =over 4
@@ -160,9 +160,9 @@
 sequences for the terminal from termcap, and use that information in
 formatting the output.  Output will be wrapped at two columns less than the
 width of your terminal device.  Using this option requires that your system
-have a termcap file somewhere where Term::Cap can find it.  With this
-option, the output of B<pod2text> will contain terminal control sequences
-for your current terminal type.
+have a termcap file somewhere where Term::Cap can find it and requires that
+your system support termios.  With this option, the output of B<pod2text>
+will contain terminal control sequences for your current terminal type.
 
 =item B<-w>, B<--width=>I<width>, B<->I<width>
 

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About