conf mode added

--HG--
branch : pmacs2
This commit is contained in:
moculus 2008-04-07 20:09:18 +00:00
parent 4d3769233e
commit d3fa803e76
3 changed files with 19 additions and 7 deletions

View File

@ -116,7 +116,7 @@ class Application(object):
'make', 'mini', 'mutt', 'nasm', 'ocaml', 'perl', 'python',
'replace', 'rst', 'scheme', 'search', 'sh', 'sql', 'tt',
'text', 'text2', 'which', 'xml', 'cheetah', 'colortext',
'latex', 'insertmini')
'latex', 'insertmini', 'conf')
for name in names:
exec("import mode.%s; mode.%s.install(self)" % (name, name))

View File

@ -137,9 +137,3 @@ class BufferList(object):
def is_buffer_hidden(self, b):
assert b in self.buffers, "buffer %s does not exist" % (b.name())
return b in self.hidden_buffers
# def is_buffer_visible(self, b):
# assert b in self.buffers, "buffer %s does not exist" % (b.name())
# for slot in self.slots:
# if slot.buffer is b:
# return True
# return False

18
mode/conf.py Normal file
View File

@ -0,0 +1,18 @@
import color, mode
from lex import Grammar, PatternRule, RegionRule
from mode.sh import StringGrammar
class ConfGrammar(Grammar):
rules = [
PatternRule(r'comment', r'#.*$'),
RegionRule(r'string', r"'", Grammar, r"'"),
RegionRule(r'string', r'"', StringGrammar, r'"'),
]
class Conf(mode.Fundamental):
modename = 'conf'
extensions = ['.conf', '.cfg', '.cnf', '.config']
grammar = ConfGrammar
colors = {}
install = Conf.install