develooper Front page | perl.perl5.porters | Postings from November 2004

Re: [PATCH] Cygwin Pod::Perldoc issues

Thread Previous
From:
steve
Date:
November 26, 2004 13:39
Subject:
Re: [PATCH] Cygwin Pod::Perldoc issues
Message ID:
20041126213923.GA12836@mccoy.peters.homeunix.org
On Fri, Nov 26, 2004 at 08:08:12PM +0000, Matt Johnson wrote:
> Enclosed is a proposed patch for two Pod::Perldoc issues under Cygwin.
> 
> 1) Cygwin's 'less' will not render ANSI ESC sequences by default. The 
> correct invocation of 'less' for man page purposes is 'less -isrR'. A patch 
> added to PerlDoc.pm to check the first priority pager, and, if it appears 
> to be 'less', fix up its options. I'd assume that if someone has set 
> PERLDOC_PAGER they really absolutely know what they are doing and don't 
> want to be nannied.
> 
> 2) nroff on cygwin requires -c switch in order to render ESC[22m properly. 
> Patch to Pod/Perldoc/ToMan.pm to add -c switch to Cygwin nroff.
> 
> Patch follows:
> 
> --- bleadperl/lib/Pod/Perldoc/ToMan.pm  2004-06-09 11:18:26.000000000 +0100
> +++ bleadperl/lib/Pod/Perldoc/ToMan.pm  2004-11-26 19:53:33.609375000 +0000
> @@ -72,6 +72,10 @@
>      $command .= ' -rLL=' . (int $c) . 'n' if $cols > 80;
>    }
> 
> +  if(Pod::Perldoc::IS_Cygwin) {
> +    $command .= ' -c';
> +  }
> +
>    # I hear persistent reports that adding a -c switch to $render
>    # solves many people's problems.  But I also hear that some mans
>    # don't have a -c switch, so that adding it here would presumably
> 
> --- bleadperl/lib/Pod/Perldoc.pm        2004-06-09 11:18:26.000000000 +0100
> +++ bleadperl/lib/Pod/Perldoc.pm        2004-11-26 19:54:25.234375000 +0000
> @@ -1231,6 +1231,11 @@
>          }
>          push @pagers, qw( more less pg view cat );
>          unshift @pagers, $ENV{PAGER}  if $ENV{PAGER};
> +        if (IS_Cygwin) {
> +            if (($pagers[0] eq 'less') || ($pagers[0] eq '/usr/bin/less')) 
> {
> +                unshift @pagers, '/usr/bin/less -isrR';
> +            }
> +        }
>      }
>      unshift @pagers, $ENV{PERLDOC_PAGER} if $ENV{PERLDOC_PAGER};
> 
> 
> 
> -- 
> Matt Johnson <mattj@avsim.com>
>

I submitted a similar patch for Pod::Perldoc in the Perlbug queue (RT #31997)
and at the Pod-Perldoc queue at CPAN (https://rt.cpan.org/NoAuth/Bug.html?id=8376).
I need to ping the module owner regarding my patch.  I'd suggest sending the
patch to the module owner directly for Pod::Perldoc::ToMan.

Steve Peters
steve@fisharerojo.org

Thread Previous


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