[SVN] Re: Addition to Perl Textmate Bundle
Eric Hsu
erichsu at math.sfsu.edu
Thu Oct 12 20:22:24 UTC 2006
hi folks,
I got this e-mail from Booker C. Bense who wrote an improvement to
the Perl bundle. Is there anyone with a little free time who's been
in the Perl bundle recently who would like to check it out and check
this change into the SVN trunk?
Between work and new daughter, I don't have the time to do this justice.
best wishes, Eric
> I hacked up the documentation command to understand the difference
> between simple commands and modules. Here it is if you're interested.
> Not as clean as I would like, but I couldn't get the quoting for
> the sed script right. It would be ideal if the perl mode understood
> that GetOpts::Long was a word, but I haven't got that far in TextMate
> yet. If you select GetOpts::Word, it all just works.
>
> Enjoy,
>
> _ Booker C. Bense
>
> word=${TM_SELECTED_TEXT:-$TM_CURRENT_WORD}
> opts=`perl -ne '/\:/ ? print "-u" : print "-u -f"' <<< $word `
> if [[ $opts == "-u" ]]
> then perldoc $opts "$word" 2>/dev/null | pod2html --q --title "Perl
> Documentation - $word" 2>/dev/null
> else
> perldoc -u -f "$word" 2>/dev/null | pod2html --q --title "Perl
> Documentation - $word" 2>/dev/null | sed -E 's|<a href="#(item_)?
> ([^"]+)">|<a href="http://perldoc.perl.org/search.html?q=\2">|g'
> fi
>
> if [[ -e "${TM_DIRECTORY}/pod2htmd.tmp" ]]
> then unlink "${TM_DIRECTORY}/pod2htmd.tmp"
> fi
> if [[ -e "${TM_DIRECTORY}/pod2htmi.tmp" ]]
> then unlink "${TM_DIRECTORY}/pod2htmi.tmp"
> fi
>
>
--
Eric Hsu, Associate Professor of Mathematics
San Francisco State University
http://math.sfsu.edu/hsu
erichsu at math.sfsu.edu
More information about the textmate-dev
mailing list