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

[PATCH] Cygwin Pod::Perldoc issues

Thread Next
From:
Matt Johnson
Date:
November 26, 2004 12:08
Subject:
[PATCH] Cygwin Pod::Perldoc issues
Message ID:
41A78D2C.8040507@avsim.com
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>



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.289 / Virus Database: 265.4.2 - Release Date: 24/11/2004


Thread Next


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