From d9d025f2d0a81a007207423dfb77072a2a72a29c Mon Sep 17 00:00:00 2001 From: moculus Date: Thu, 18 Oct 2007 15:28:55 +0000 Subject: [PATCH] config support --HG-- branch : pmacs2 --- application.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/application.py b/application.py index b0511e6..31bb41d 100755 --- a/application.py +++ b/application.py @@ -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