This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Sync Pod-Perldoc with CPAN version 3.28.
authorJames E Keenan <jkeenan@cpan.org>
Fri, 17 Mar 2017 23:10:50 +0000 (19:10 -0400)
committerJames E Keenan <jkeenan@cpan.org>
Fri, 17 Mar 2017 23:10:50 +0000 (19:10 -0400)
This should enable us to close
https://rt.perl.org/Ticket/Display.html?id=130759.

14 files changed:
Porting/Maintainers.pl
cpan/Pod-Perldoc/lib/Pod/Perldoc.pm
cpan/Pod-Perldoc/lib/Pod/Perldoc/BaseTo.pm
cpan/Pod-Perldoc/lib/Pod/Perldoc/GetOptsOO.pm
cpan/Pod-Perldoc/lib/Pod/Perldoc/ToANSI.pm
cpan/Pod-Perldoc/lib/Pod/Perldoc/ToChecker.pm
cpan/Pod-Perldoc/lib/Pod/Perldoc/ToMan.pm
cpan/Pod-Perldoc/lib/Pod/Perldoc/ToNroff.pm
cpan/Pod-Perldoc/lib/Pod/Perldoc/ToPod.pm
cpan/Pod-Perldoc/lib/Pod/Perldoc/ToRtf.pm
cpan/Pod-Perldoc/lib/Pod/Perldoc/ToTerm.pm
cpan/Pod-Perldoc/lib/Pod/Perldoc/ToText.pm
cpan/Pod-Perldoc/lib/Pod/Perldoc/ToTk.pm
cpan/Pod-Perldoc/lib/Pod/Perldoc/ToXml.pm

index 1501d6b..b47775e 100755 (executable)
@@ -923,7 +923,7 @@ use File::Glob qw(:case);
     },
 
     'Pod::Perldoc' => {
-        'DISTRIBUTION' => 'MALLEN/Pod-Perldoc-3.27.tar.gz',
+        'DISTRIBUTION' => 'MALLEN/Pod-Perldoc-3.28.tar.gz',
         'FILES'        => q[cpan/Pod-Perldoc],
 
         # Note that we use the CPAN-provided Makefile.PL, since it
index 1999f01..8d695b2 100644 (file)
@@ -12,7 +12,7 @@ use File::Spec::Functions qw(catfile catdir splitdir);
 use vars qw($VERSION @Pagers $Bindir $Pod2man
   $Temp_Files_Created $Temp_File_Lifetime
 );
-$VERSION = '3.27';
+$VERSION = '3.28';
 
 #..........................................................................
 
@@ -851,8 +851,11 @@ sub grand_search_init {
                    =~ s/\.P(?:[ML]|OD)\z//;
             }
             else {
-                print STDERR "No " .
+              print STDERR "No " .
                     ($self->opt_m ? "module" : "documentation") . " found for \"$_\".\n";
+              if ( /^https/ ) {
+                print STDERR "You may need an SSL library (such as IO::Socket::SSL) for that URL.\n";
+              }
             }
             next;
         }
@@ -1697,7 +1700,7 @@ sub pagers_guessing {
         unshift @pagers, "$ENV{PERLDOC_PAGER} <" if $ENV{PERLDOC_PAGER};
     }
 
-    $self->aside("Pagers: ", @pagers);
+    $self->aside("Pagers: ", (join ", ", @pagers));
 
     return;
 }
@@ -1934,11 +1937,11 @@ sub page {  # apply a pager to the output file
            } elsif($self->is_amigaos) { 
                 last if system($pager, $output) == 0;
             } else {
-                # fix visible escape codes in ToTerm output
-                # https://bugs.debian.org/758689
-                local $ENV{LESS} = defined $ENV{LESS} ? "$ENV{LESS} -R" : "-R";
-               # On FreeBSD, the default pager is more.
-                local $ENV{MORE} = defined $ENV{MORE} ? "$ENV{MORE} -R" : "-R";
+                my $formatter = $self->{'formatter_class'};
+                if ( $formatter->can('pager_configuration') ) {
+                  $self->aside("About to call $formatter" . "->pager_configuration(\"$pager\")\n");
+                  $formatter->pager_configuration($pager, $self);
+                }
                 last if system("$pager \"$output\"") == 0;
             }
         }
index 5bab1e3..37f6510 100644 (file)
@@ -3,7 +3,7 @@ use strict;
 use warnings;
 
 use vars qw($VERSION);
-$VERSION = '3.27';
+$VERSION = '3.28';
 
 use Carp                  qw(croak carp);
 use Config                qw(%Config);
index e88f0d3..afa2574 100644 (file)
@@ -2,7 +2,7 @@ package Pod::Perldoc::GetOptsOO;
 use strict;
 
 use vars qw($VERSION);
-$VERSION = '3.27';
+$VERSION = '3.28';
 
 BEGIN { # Make a DEBUG constant ASAP
   *DEBUG = defined( &Pod::Perldoc::DEBUG )
index aa41423..8217c7b 100644 (file)
@@ -4,7 +4,7 @@ use warnings;
 use parent qw(Pod::Perldoc::BaseTo);
 
 use vars qw($VERSION);
-$VERSION = '3.27';
+$VERSION = '3.28';
 
 sub is_pageable        { 1 }
 sub write_with_binmode { 0 }
index 7420c45..a6dbbe3 100644 (file)
@@ -4,7 +4,7 @@ use warnings;
 use vars qw(@ISA);
 
 use vars qw($VERSION);
-$VERSION = '3.27';
+$VERSION = '3.28';
 
 # Pick our superclass...
 #
index 6e18b37..bfcb5c4 100644 (file)
@@ -5,7 +5,7 @@ use warnings;
 use parent qw(Pod::Perldoc::BaseTo);
 
 use vars qw($VERSION);
-$VERSION = '3.27';
+$VERSION = '3.28';
 
 use File::Spec::Functions qw(catfile);
 use Pod::Man 2.18;
index ec9dc22..a52f616 100644 (file)
@@ -4,7 +4,7 @@ use warnings;
 use parent qw(Pod::Perldoc::BaseTo);
 
 use vars qw($VERSION);
-$VERSION = '3.27';
+$VERSION = '3.28';
 
 # This is unlike ToMan.pm in that it emits the raw nroff source!
 
index 0eda0af..825a1ca 100644 (file)
@@ -4,7 +4,7 @@ use warnings;
 use parent qw(Pod::Perldoc::BaseTo);
 
 use vars qw($VERSION);
-$VERSION = '3.27';
+$VERSION = '3.28';
 
 sub is_pageable        { 1 }
 sub write_with_binmode { 0 }
index 69bc254..d084816 100644 (file)
@@ -4,7 +4,7 @@ use warnings;
 use parent qw( Pod::Simple::RTF );
 
 use vars qw($VERSION);
-$VERSION = '3.27';
+$VERSION = '3.28';
 
 sub is_pageable        { 0 }
 sub write_with_binmode { 0 }
index 64cfb01..9501d63 100644 (file)
@@ -3,7 +3,7 @@ use strict;
 use warnings;
 
 use vars qw($VERSION);
-$VERSION = '3.27';
+$VERSION = '3.28';
 
 use parent qw(Pod::Perldoc::BaseTo);
 
@@ -26,6 +26,34 @@ sub width     {
        $self->_get_default_width;
 }
 
+sub pager_configuration {
+  my($self, $pager, $perldoc) = @_;
+
+  # do not modify anything on Windows or DOS
+  return if ( $perldoc->is_mswin32 || $perldoc->is_dos );
+
+  if ( $pager =~ /less/ ) {
+    $self->_maybe_modify_environment('LESS');
+  }
+  elsif ( $pager =~ /more/ ) {
+    $self->_maybe_modify_environment('MORE');
+  }
+
+  return;
+}
+
+sub _maybe_modify_environment {
+  my($self, $name) = @_;
+
+  if ( ! defined $ENV{$name} ) {
+    $ENV{$name} = "-R";
+  }
+
+  # if the environment is set, don't modify
+  # anything
+
+}
+
 sub _get_stty { `stty -a` }
 
 sub _get_columns_from_stty {
@@ -89,7 +117,7 @@ sub parse_from_file {
 
 =head1 NAME
 
-Pod::Perldoc::ToTerm - render Pod with terminal escapes 
+Pod::Perldoc::ToTerm - render Pod with terminal escapes
 
 =head1 SYNOPSIS
 
@@ -107,6 +135,14 @@ For example:
 
   perldoc -o term -w indent:5 Some::Modulename
 
+=head1 PAGER FORMATTING
+
+Depending on the platform, and because this class emits terminal escapes it
+will attempt to set the C<-R> flag on your pager by injecting the flag into
+your environment variable for C<less> or C<more>.
+
+On Windows and DOS, this class will not modify any environment variables.
+
 =head1 CAVEAT
 
 This module may change to use a different text formatter class in the
@@ -118,7 +154,7 @@ L<Pod::Text>, L<Pod::Text::Termcap>, L<Pod::Perldoc>
 
 =head1 COPYRIGHT AND DISCLAIMERS
 
-Copyright (c) 2011 Mark Allen.
+Copyright (c) 2017 Mark Allen.
 
 This program is free software; you can redistribute it and/or modify it
 under the terms of either: the GNU General Public License as published
index cdaaa49..99ab66c 100644 (file)
@@ -3,7 +3,7 @@ use strict;
 use warnings;
 
 use vars qw($VERSION);
-$VERSION = '3.27';
+$VERSION = '3.28';
 
 use parent qw(Pod::Perldoc::BaseTo);
 
index 727b312..6ca7542 100644 (file)
@@ -3,7 +3,7 @@ use strict;
 use warnings;
 
 use vars qw($VERSION);
-$VERSION = '3.27';
+$VERSION = '3.28';
 
 use parent qw(Pod::Perldoc::BaseTo);
 
index ca1ab3c..0161c04 100644 (file)
@@ -6,7 +6,7 @@ use vars qw($VERSION);
 use parent qw( Pod::Simple::XMLOutStream );
 
 use vars qw($VERSION);
-$VERSION = '3.27';
+$VERSION = '3.28';
 
 sub is_pageable        { 0 }
 sub write_with_binmode { 0 }