summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2010-04-05 08:09:07 +0000
committerManuel Pégourié-Gonnard <mpg@elzevir.fr>2010-04-05 08:09:07 +0000
commit9fca5b4cf316df27359c58f6f46ddcc8e4a47f96 (patch)
tree167ac72d7215e1ab9497e5457fe1696f478fcc7f
parent8ef0751fd296a6ef6bcb8b1f568bf4b3c36c1570 (diff)
Real texdoc search function.
git-svn-id: svn://tug.org/texlive/trunk@17704 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xMaster/texmf/scripts/tetex/texdoctk.pl20
1 files changed, 16 insertions, 4 deletions
diff --git a/Master/texmf/scripts/tetex/texdoctk.pl b/Master/texmf/scripts/tetex/texdoctk.pl
index 58764ac6181..6f4673d3781 100755
--- a/Master/texmf/scripts/tetex/texdoctk.pl
+++ b/Master/texmf/scripts/tetex/texdoctk.pl
@@ -815,10 +815,22 @@ sub srchtd {
my ($string) = @_;
my @res;
my $idx = -1; # dummy index for @packname, @topic and @keywords
- $packname[-1][0] = "texdoc";
- $topic[-1][0] = "Find documentation in TeX Live";
- $doc[-1][0] = "texdoc/texdoc.pdf";
- return (-1, 0);
+ my $tdout = `texdoc -M -l $string`;
+ if ($?) {
+ &popmsg(0,"texdoc failed, sorry: $!\n".
+ "Please report this problem on the texlive mailing list.\n");
+ return;
+ } else {
+ my $i = 0;
+ for my $line (split /\n/, $tdout) {
+ my @fields = split /\t/, $line;
+ $doc[$idx][$i] = $fields[2];
+ $topic[$idx][$i] = basename($fields[2]);
+ $packname[$idx][$i] = "no package name";
+ push @res, ($idx, $i++);
+ }
+ return @res;
+ }
}
# search a string in @packname, @topic and @keywords