config support

--HG--
branch : pmacs2
This commit is contained in:
moculus 2007-10-18 15:28:55 +00:00
parent 52b2c9d10d
commit d9d025f2d0
1 changed files with 16 additions and 3 deletions

View File

@ -16,7 +16,7 @@ import mode.lisp, mode.elisp, mode.scheme, mode.ocaml
import mode.blame, mode.diff, mode.dir
import mode.xml, mode.tt, mode.css, mode.javascript, mode.html, mode.hex
import mode.text, mode.text2, mode.mutt
import mode.bds
#import mode.bds
import mode.rst
def run(buffers, jump_to_line=None, init_mode=None):
@ -109,7 +109,7 @@ class Application(object):
'javascript': mode.javascript.Javascript,
'sql': mode.sql.Sql,
'template': mode.tt.Template,
'bds': mode.bds.BDS,
#'bds': mode.bds.BDS,
'rst': mode.rst.RST,
'java': mode.java.Java,
'hex': mode.hex.Hex,
@ -132,7 +132,7 @@ class Application(object):
'.bashrc': 'sh',
'.bash_profile': 'sh',
'.profile': 'sh',
'components.xml': 'bds',
#'components.xml': 'bds',
'.emacs': 'elisp',
'Makefile': 'make',
}
@ -187,6 +187,9 @@ class Application(object):
height = self.y - 2
width = self.x - 1
# run user custom code here
self.loadrc()
# initialize our buffers
# note that the first buffer in buffers will be initially visible
buffers.append(buffer2.ScratchBuffer())
@ -466,6 +469,16 @@ class Application(object):
def eval(self, s):
return eval(s)
#
def loadmode(self, name, path):
pass
# load user configuration NOW
def loadrc(self):
path = os.path.join(os.getenv('HOME'), '.pmc', 'conf')
if os.path.exists(path):
execfile(path)
# the mighty run-loop!
def run(self):
self.done = False