pmacs3/mode_mutt.py

44 lines
1.5 KiB
Python
Raw Normal View History

2007-03-06 10:05:38 -05:00
import sets, sys
import color, mode, lex, lex_mutt, method, mode_text
class Mutt(mode.Fundamental):
def __init__(self, w):
mode.Fundamental.__init__(self, w)
self.add_action_and_bindings(mode_text.LearnWord(), ('C-c l',))
self.add_action_and_bindings(MuttWrapParagraph(), ('M-q',))
#self.add_action_and_bindings(MuttWrapLine(), ('M-q',))
self.add_action_and_bindings(MuttInsertSpace(), ('SPACE',))
self.grammar = lex_mutt.MuttGrammar()
self.lexer = lex.Lexer(self.grammar)
self.default_color = color.build('default', 'default')
self.colors = {
'header': color.build('green', 'default', 'bold'),
'email': color.build('cyan', 'default', 'bold'),
'url': color.build('cyan', 'default', 'bold'),
'misspelled word': color.build('red', 'default', 'bold'),
'misspelled continued word': color.build('red', 'default', 'bold'),
'quote1': color.build('yellow', 'default', 'bold'),
'quote2': color.build('cyan', 'default', 'bold'),
'quote3': color.build('magenta', 'default', 'bold'),
}
#self.highlighter.lex_buffer()
#self.get_regions()
def name(self):
return "Mutt"
class MuttWrapLine(method.WrapLine):
limit = 72
class MuttWrapParagraph(method.WrapParagraph):
wrapper = MuttWrapLine
class MuttInsertSpace(mode_text.TextInsertSpace):
limit = 72
wrapper = MuttWrapParagraph