/usr/share/vile/perl/Vile/Manual.pm is in vile-common 9.8l-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | package Vile::Manual;
use strict;
use Carp;
require Exporter;
use vars qw(@ISA @EXPORT);
@ISA = qw(Exporter);
@EXPORT = qw(manual);
sub manual {
my $pm = (caller) . '.pm';
( my $path = $pm ) =~ s!::!/!g;
$path = $INC{$path};
croak "can't get path for module $pm" unless $path;
my $b = edit Vile::Buffer "<$pm>";
if ( !$b or $b->dotq('$') <= 1 ) {
$b = new Vile::Buffer "<$pm>" unless $b;
local *P;
my $pid = open P, '-|';
croak "can't fork ($!)" unless defined $pid;
unless ($pid) {
my $filt = Vile::get('libdir-path') . '/vile-manfilt';
if ( $^O =~ /^(MSWin32|dos)$/ or !-x $filt ) {
require Pod::Text;
Pod::Text::pod2text($path);
}
else {
untie *STDERR;
open STDERR, '>/dev/null'; # supress pod2man whining
system "pod2man --lax $path|nroff -man|$filt";
}
exit;
}
print $b join '', <P>;
close P;
$b->setregion( 1, '$' )->attribute_cntl_a_sequences->unmark->dot(1);
}
Vile::current_window->buffer($b);
}
1;
__DATA__
=head1 NAME
manual - construct manual page from embedded pod documentation
=head1 SYNOPSIS
In a vile extension module:
use Vile::Manual;
%REGISTRY = (
...
'vile-command-help' => [ sub {&manual},
'manual page for vile-command'] );
=head1 DESCRIPTION
The Vile::Manual package provides a mechanism for extracting and
displaying as a manual page (in the editor) the pod documentation
embedded along with a vile extension.
=head1 BUGS
Does not do any sort of highlighting.
=head1 NOTES
I'm not convinced that this is the best mechanism for displaying man
pages for the perl extensions.
=head1 AUTHOR
Kevin Buettner
=cut
|