Hi Andrew,

Andrew Fresh wrote on Sun, May 05, 2019 at 02:44:58PM -0700:
> On Sun, May 05, 2019 at 04:53:05PM +0200, Ingo Schwarze wrote:

>> The first chunk in the patch below seems to be all that is needed.
>> IIRC, we already do a similar thing in pod2man(1).

> This is true, we do similar in pod2man and so the same fix here seems
> correct.
> 
> When trying to push this upstream I will probably set it to 1 only if
> $self->_is_mandoc, and then someone else can figure out adding it if
> they're stuck on groff.

Right, let someone else figure out which ancient versions of groff
support UTF-8 in which ways...  :-)

Solaris 11 has 1.22 (2013), Solaris 9 has 1.21 (2009), and rumour
has it that MacOS X might still have 1.19 (2004/05)...

> (that is assuming that there's not some crappy mandoc that's popular
> on some strange system that perl wants to support,

I very much doubt that, unless some system uses mandoc that i
never heard about.  Look at https://mandoc.bsd.lv/ports.html :
The oldest mandoc still in use anywhere is 1.14.3, on Alpine and
on Ubuntu-oldstable Aardvark.  Oh wait, Debian-stable Stretch
still has 1.13.3, but even that should be just fine: according to
https://mandoc.bsd.lv/devhistory.html , direct UTF-8 input to mandoc
works since 1.13.2 (Dec. 2014).  Well, DragonFly still has 1.13.1,
but they are totally outdated anyway and while they do ship an
ancient mandoc, they don't actually use it for anything.

> but I will suggest it anyway.

Sounds like a safe bet.

> It does appear that the -Owidth patch does what Pod::Perldoc wants it
> to.  So, although I find it harder to read when it spans a wide
> terminal,

True, but using MANWIDTH and falling back to stty(1) is an upstream
user interface decision which we probably shouldn't interfere with.  
It has nothing to do with the rendering backend in use.

If people dislike the upstream default, they can use a narrower
window or "export MANWIDTH=80" or "stty columns 80".

> both of these are:
> OK afresh1@

Both committed, thanks for checking.
  Ingo


> > Index: ToMan.pm
> > ===================================================================
> > RCS file: 
> > /cvs/src/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToMan.pm,v
> > retrieving revision 1.9
> > diff -u -p -r1.9 ToMan.pm
> > --- ToMan.pm        4 May 2019 01:14:34 -0000       1.9
> > +++ ToMan.pm        5 May 2019 14:39:01 -0000
> > @@ -144,7 +144,9 @@ sub _get_podman_switches {
> >      #
> >      # See RT #77465
> >      #
> > -    #push @switches, 'utf8' => 1;
> > +    # Then again, do *not* comment it out on OpenBSD:
> > +    # mandoc handles UTF-8 input just fine.
> > +    push @switches, 'utf8' => 1;
> >  
> >     $self->debug( "Pod::Man switches are [@switches]\n" );
> >  
> > @@ -225,6 +227,10 @@ sub _collect_nroff_switches {
> >             my $c = $cols * 39 / 40;
> >             $cols = $c > $cols - 2 ? $c : $cols -2;
> >             push @render_switches, '-rLL=' . (int $c) . 'n' if $cols > 80;
> > +           }
> > +
> > +   if( $self->_is_mandoc ) {
> > +           push @render_switches, '-Owidth=' . $self->_get_columns;
> >             }
> >  
> >     # I hear persistent reports that adding a -c switch to $render

Reply via email to