branch : pmacs2
This commit is contained in:
moculus 2009-03-14 23:53:44 +00:00
parent 42d9148737
commit 08741a9da5
2 changed files with 13 additions and 7 deletions

View File

@ -221,7 +221,8 @@ class PerlCheckSyntax(Method):
b.orig_path = w.buffer.path b.orig_path = w.buffer.path
if retval == 0: a.set_error("Syntax OK") if retval == 0: a.set_error("Syntax OK")
class PerlViewModulePerldoc(Method):
class PerldocModule(Method):
'''View documentation about this buffer using perldoc''' '''View documentation about this buffer using perldoc'''
prog = 'use Pod::Text;' \ prog = 'use Pod::Text;' \
'Pod::Text->new(sentence=>0, width=>78)->parse_from_filehandle();' 'Pod::Text->new(sentence=>0, width=>78)->parse_from_filehandle();'
@ -230,7 +231,7 @@ class PerlViewModulePerldoc(Method):
args = ('perl', '-e', self.prog) args = ('perl', '-e', self.prog)
app.run_pipe(args, w.buffer, '*Perldoc*', True) app.run_pipe(args, w.buffer, '*Perldoc*', True)
class PerlViewPerldoc(Method): class Perldoc(Method):
name_re = re.compile('(?:[a-zA-Z_][a-zA-Z0-9_]*::)*[a-zA-Z_][a-zA-Z0-9_]*') name_re = re.compile('(?:[a-zA-Z_][a-zA-Z0-9_]*::)*[a-zA-Z_][a-zA-Z0-9_]*')
args = [Argument("name", type(""), "", "Perldoc: ")] args = [Argument("name", type(""), "", "Perldoc: ")]
def _execute(self, w, **vargs): def _execute(self, w, **vargs):
@ -277,7 +278,7 @@ class PerlViewPerldoc(Method):
w.application.data_buffer("*Perldoc*", data, switch_to=True) w.application.data_buffer("*Perldoc*", data, switch_to=True)
w.application.set_error('displaying documentation for %r' % name) w.application.set_error('displaying documentation for %r' % name)
class PerlViewWordPerldoc(PerlViewPerldoc): class PerldocWord(Perldoc):
'''View documentation about a package or function using perldoc''' '''View documentation about a package or function using perldoc'''
args = [] args = []
def _execute(self, w, **vargs): def _execute(self, w, **vargs):
@ -733,8 +734,7 @@ class Perl(mode.Fundamental):
'perl.libs': ['lib'], 'perl.libs': ['lib'],
} }
actions = [PerlSetLib, PerlCheckSyntax, PerlHashCleanup, actions = [PerlSetLib, PerlCheckSyntax, PerlHashCleanup,
PerlViewModulePerldoc, PerlViewWordPerldoc, PerlViewPerldoc, PerldocModule, PerldocWord, Perldoc, PerlWrapParagraph,
PerlWrapParagraph,
PerlInitFunctions, PerlGotoFunction, PerlWhichFunction, PerlInitFunctions, PerlGotoFunction, PerlWhichFunction,
PerlListFunctions, PerlOpenModule, PerlOpenModuleWord, PerlListFunctions, PerlOpenModule, PerlOpenModuleWord,
PerlSemanticComplete] PerlSemanticComplete]
@ -752,8 +752,10 @@ class Perl(mode.Fundamental):
self.add_bindings('perl-set-lib', ('C-c l',)) self.add_bindings('perl-set-lib', ('C-c l',))
self.add_bindings('perl-check-syntax', ('C-c s',)) self.add_bindings('perl-check-syntax', ('C-c s',))
self.add_bindings('perl-hash-cleanup', ('C-c h',)) self.add_bindings('perl-hash-cleanup', ('C-c h',))
self.add_bindings('perl-view-module-perldoc', ('C-c v',)) #self.add_bindings('perl-view-module-perldoc', ('C-c v',))
self.add_bindings('perl-view-word-perldoc', ('C-c p',)) #self.add_bindings('perl-view-word-perldoc', ('C-c p',))
self.add_bindings('perldoc-module', ('C-c v',))
self.add_bindings('perldoc-word', ('C-c p',))
self.add_bindings('perl-wrap-paragraph', ('M-q',)) self.add_bindings('perl-wrap-paragraph', ('M-q',))
self.add_bindings('perl-goto-function', ('C-c M-g',)) self.add_bindings('perl-goto-function', ('C-c M-g',))
self.add_bindings('perl-open-module', ('C-c C-f',)) self.add_bindings('perl-open-module', ('C-c C-f',))

View File

@ -1,5 +1,6 @@
import color, method, mode import color, method, mode
from lex import Grammar, PatternRule, RegionRule, PatternGroupRule, OverrideRegionRule from lex import Grammar, PatternRule, RegionRule, PatternGroupRule, OverrideRegionRule
from method import Method
from mode.text import TextInsertSpace from mode.text import TextInsertSpace
from mode.python import PythonGrammar from mode.python import PythonGrammar
@ -49,6 +50,9 @@ class RstInsertSpace(TextInsertSpace):
limit = 75 limit = 75
wrapper = RstWrapParagraph wrapper = RstWrapParagraph
class RstBuild(Method):
pass
class RST(mode.Fundamental): class RST(mode.Fundamental):
modename = 'RST' modename = 'RST'
extensions = ['.rst'] extensions = ['.rst']