branch : pmacs2
This commit is contained in:
moculus 2007-07-25 20:52:48 +00:00
parent f8aa9c2cab
commit 71a6beee8e
1 changed files with 15 additions and 11 deletions

26
MODES
View File

@ -9,18 +9,22 @@ buffer should be indented, and any other per-buffer configuration. The default
mode ("Fundamental") provides the base functionality which all other modes mode ("Fundamental") provides the base functionality which all other modes
inherit. inherit.
2. Where do they come from?
All modes are loaded and installed in application.py. It would be nice if there All modes are loaded and installed in application.py. It would be nice if there
was a configuration file where you could add your own modes, but there isn't. was a configuration file where you could add your own modes, but there isn't.
Loading a module involves the following: Loading a module involves the following (in Application.__init__):
# mandatory; modename should be lowercase
self.modes[modename] = package.ModeClass
# specify full paths which should use this mode self.modes['foo'] = package.Foo
self.mode_paths['/some/full/path'] = 'modename'
# specify filenames (i.e. .bashrc) which should use this mode # ...
self.mode_basenames['filename'] = 'modename'
# specify file extensions (i.e. .txt) which should use this mode self.mode_paths['/some/full/path'] = 'foo'
self.mode_extensions['.junk'] = 'modename' self.mode_basenames['some-filename'] = 'foo'
# specify executable name in comment (i.e. bash from #!/usr/bin/bash) self.mode_extensions['.foo'] = 'foo'
self.mode_detection['junk'] = 'modename' self.mode_detection['foo'] = 'foo'
The last is for detecting scripts using the "#!/usr/bin/foo" syntax.
3. How do they work?