import mode from lex import Grammar, PatternRule, RegionRule, PatternGroupRule class AboutGrammar(Grammar): rules = [ PatternRule(r'about_stars', r'\*+'), PatternRule(r'about_equals', r'=+'), PatternRule(r'about_pmacs', r'pmacs'), PatternRule(r'about_author', r'Erik Osheim'), PatternRule(r'about_copyright', r'\(c\) 2005-2008'), PatternRule(r'about_license', r'GNU General Public License v2'), PatternRule(r'about_binding', r'C-c M-h'), PatternRule(r'about_command', r'\(show-bindings-buffer\)'), ] class About(mode.Fundamental): modename = 'About' grammar = AboutGrammar() colors = { 'about_stars': ('yellow', 'default', 'bold'), 'about_equals': ('red', 'default', 'bold'), 'about_pmacs': ('cyan', 'default', 'bold'), 'about_author': ('cyan', 'default', 'bold'), 'about_copyright': ('blue', 'default', 'bold'), 'about_license': ('cyan', 'default', 'bold'), 'about_binding': ('cyan', 'default', 'bold'), 'about_command': ('blue', 'default', 'bold'), } install = About.install