From d6d80218ef4c26c06c44b0d69ae8452623797543 Mon Sep 17 00:00:00 2001 From: moculus Date: Tue, 24 Mar 2009 17:01:54 +0000 Subject: [PATCH] --HG-- branch : pmacs2 --- mode/perl.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/mode/perl.py b/mode/perl.py index 9c1c009..e03e479 100644 --- a/mode/perl.py +++ b/mode/perl.py @@ -282,6 +282,20 @@ class Perldoc(Method): w.application.color_data_buffer("*Perldoc*", data, switch_to=True) w.set_error('displaying perldoc for %r' % name) +class PerldocF(Perldoc): + def _execute(self, w, **vargs): + name = vargs['name'] + if not self.name_re.match(name): + w.set_error("name %r is invalid" % name) + return + + # then try it as a function + data = self._try(w, name, asfunc=True) + if data: + self._show(w, data, name) + else: + w.set_error('nothing found for %r' % name) + class PerldocWord(Perldoc): '''View documentation about a package or function using perldoc''' args = [] @@ -728,7 +742,7 @@ class Perl(mode.Fundamental): config = {} lconfig = {'perl.libs': []} actions = [PerlSetLib, PerlCheckSyntax, PerlHashCleanup, - PerldocModule, PerldocWord, Perldoc, PerlWrapParagraph, + PerldocModule, PerldocWord, Perldoc, PerldocF, PerlWrapParagraph, PerlInitFunctions, PerlGotoFunction, PerlWhichFunction, PerlListFunctions, PerlOpenModule, PerlOpenModuleWord, PerlSemanticComplete]