branch : pmacs2
This commit is contained in:
moculus 2007-10-19 06:41:33 +00:00
parent 62f7057c8d
commit 7a374ea5b1
34 changed files with 96 additions and 31 deletions

View File

@ -93,38 +93,39 @@ class Application(object):
self.mode_extensions = {}
self.mode_detection = {}
mode2.Fundamental.install(self)
mode.blame.Blame.install(self)
mode.c.C.install(self)
mode.console.Console.install(self)
mode.consolemini.ConsoleMini.install(self)
mode.css.CSS.install(self)
mode.diff.Diff.install(self)
mode.dir.Dir.install(self)
mode.elisp.ELisp.install(self)
mode.hex.Hex.install(self)
mode.html.HTML.install(self)
mode.java.Java.install(self)
mode.javascript.Javascript.install(self)
mode.lisp.Lisp.install(self)
mode.make.Make.install(self)
mode.mini.Mini.install(self)
mode.mutt.Mutt.install(self)
mode.nasm.Nasm.install(self)
mode.ocaml.Ocaml.install(self)
mode.perl.Perl.install(self)
mode.python.Python.install(self)
mode.replace.Replace.install(self)
mode.rst.RST.install(self)
mode.scheme.Scheme.install(self)
mode.search.Search.install(self)
mode.sh.Sh.install(self)
mode.sql.Sql.install(self)
mode.tt.Template.install(self)
mode.text.Text.install(self)
#mode2.Fundamental.install(self)
mode2.install(self)
mode.blame.install(self)
mode.c.install(self)
mode.console.install(self)
mode.consolemini.install(self)
mode.css.install(self)
mode.diff.install(self)
mode.dir.install(self)
mode.elisp.install(self)
mode.hex.install(self)
mode.html.install(self)
mode.java.install(self)
mode.javascript.install(self)
mode.lisp.install(self)
mode.make.install(self)
mode.mini.install(self)
mode.mutt.install(self)
mode.nasm.install(self)
mode.ocaml.install(self)
mode.perl.install(self)
mode.python.install(self)
mode.replace.install(self)
mode.rst.install(self)
mode.scheme.install(self)
mode.search.install(self)
mode.sh.install(self)
mode.sql.install(self)
mode.tt.install(self)
mode.text.install(self)
mode.text2.Text2.install(self)
mode.which.Which.install(self)
mode.xml.XML.install(self)
mode.which.install(self)
mode.xml.install(self)
# initialize our methods
self.methods = {}

View File

@ -82,3 +82,5 @@ class BDSCompileResources(Method):
class BDSRestart(Method):
def _execute(self, w, **vargs):
pass
install = BDS.install

View File

@ -22,3 +22,5 @@ class Blame(mode2.Fundamental):
'metadata.username': ('cyan', 'default', 'bold'),
'metadata.end': ('green', 'default', 'bold'),
}
install = Blame.install

View File

@ -272,3 +272,5 @@ class CMake(method.Method):
w.application.data_buffer("*CMake*", output, switch_to=err)
w.set_error(errmsg)
install = C.install

View File

@ -27,3 +27,5 @@ class Console(mode2.Fundamental):
'string.null': ('green', 'default'),
'string.end': ('green', 'default'),
}
install = Console.install

View File

@ -180,3 +180,4 @@ class ConsoleHistoryNext(method.Method):
# a.add_buffer(buffer.ConsoleBuffer())
# b = a.bufferlist.get_buffer_by_name('*Console*')
# b.insert_string(b.get_buffer_end(), repr(candidates) + '\n', force=True)
install = ConsoleMini.install

View File

@ -91,3 +91,5 @@ class CSS(mode2.Fundamental):
self.add_bindings('close-paren', (')',))
self.add_bindings('close-brace', ('}',))
self.add_bindings('close-bracket', (']',))
install = CSS.install

View File

@ -47,3 +47,5 @@ class DiffPreviousSection(method.Method):
w.goto_line(i)
return
i -= 1
install = Diff.install

View File

@ -198,3 +198,5 @@ class RemovePath(Method):
w.application.methods['refresh-view'].execute(w, filename=path)
except:
w.set_error("failed to delete %r" % path)
install = Dir.install

View File

@ -62,3 +62,5 @@ class ELisp(mode2.Fundamental):
self.add_bindings('close-bracket', (']',))
## add lisp-specific methods
#self.add_action_and_bindings(LispCheckSyntax(), ('C-c s',))
install = ELisp.install

View File

@ -85,3 +85,5 @@ class FindStrings(Method):
lastline += newline
i = (i + 1) % 4
w.application.data_buffer("*Strings*", '\n'.join(newlines), switch_to=True)
install = Hex.install

View File

@ -47,3 +47,5 @@ class HTML(mode2.Fundamental):
self.add_bindings('close-paren', (')',))
self.add_bindings('close-brace', ('}',))
self.add_bindings('close-bracket', (']',))
install = HTML.install

View File

@ -192,3 +192,5 @@ class Java(mode2.Fundamental):
self.add_bindings('close-paren', (')',))
self.add_bindings('close-brace', ('}',))
self.add_bindings('close-bracket', (']',))
install = Java.install

View File

@ -95,3 +95,5 @@ class Javascript(mode2.Fundamental):
self.add_bindings('close-paren', (')',))
self.add_bindings('close-brace', ('}',))
self.add_bindings('close-bracket', (']',))
install = Javascript.install

View File

@ -52,3 +52,5 @@ class Lisp(mode2.Fundamental):
self.add_bindings('close-paren', (')',))
self.add_bindings('close-brace', ('}',))
self.add_bindings('close-bracket', (']',))
install = Lisp.install

View File

@ -50,3 +50,5 @@ class Make(mode2.Fundamental):
'string.end': ('green', 'default'),
}
colors.update(Sh.colors)
install = Make.install

View File

@ -35,3 +35,5 @@ class MiniTabComplete(method.Method):
s1 = b.make_string()
s2, exists, complete = b.tabber.tab_string(s1, window)
b.set_data(s2)
install = Mini.install

View File

@ -50,3 +50,5 @@ class MuttWrapParagraph(method.WrapParagraph):
class MuttInsertSpace(mode.text.TextInsertSpace):
limit = 72
wrapper = MuttWrapParagraph
install = Mutt.install

View File

@ -41,3 +41,5 @@ class Nasm(mode2.Fundamental):
'instructions': ('magenta', 'default'),
'label': ('blue', 'default'),
}
install = Nasm.install

View File

@ -92,3 +92,5 @@ class Ocaml(mode2.Fundamental):
self.add_bindings('close-paren', (')',))
self.add_bindings('close-brace', ('}',))
self.add_bindings('close-bracket', (']',))
install = Ocaml.install

View File

@ -709,3 +709,5 @@ class PerlWrapParagraph(Method):
WrapParagraph._execute(self, w, **vargs)
else:
w.set_error("did not detect comment or pod lines")
install = Perl.install

View File

@ -320,3 +320,5 @@ class PythonDictCleanup(method.Method):
end_p = Point(len(w.buffer.lines[-1]), len(w.buffer.lines) - 1)
w.kill(start_p, end_p)
w.insert_string(start_p, data)
install = Python.install

View File

@ -106,3 +106,5 @@ def _end(w):
w.buffer.method.old_cursor = None
w.buffer.method.old_window = None
assert not w.application.mini_active
install = Replace.install

View File

@ -75,3 +75,5 @@ class RST(mode2.Fundamental):
'bullet': ('magenta', 'default'),
'enumeration': ('magenta', 'default'),
}
install = RST.install

View File

@ -55,3 +55,5 @@ class Scheme(mode2.Fundamental):
self.add_bindings('close-paren', (')',))
self.add_bindings('close-brace', ('}',))
self.add_bindings('close-bracket', (']',))
install = Scheme.install

View File

@ -137,3 +137,5 @@ def _end(w):
w.application.close_mini_buffer()
w.application.clear_highlighted_ranges()
w.application.last_search = w.buffer.make_string()
install = Search.install

View File

@ -164,3 +164,5 @@ class ShCheckSyntax(Method):
app.data_buffer("*Sh-Check-Syntax*", output, switch_to=False)
else:
app.data_buffer("*Sh-Check-Syntax*", output)
install = Sh.install

View File

@ -133,3 +133,5 @@ class Sql(mode2.Fundamental):
self.add_bindings('close-paren', (')',))
self.add_bindings('close-brace', ('}',))
self.add_bindings('close-bracket', (']',))
install = Sql.install

View File

@ -86,3 +86,5 @@ class LearnWord(method.Method):
# cheap way to relex just this word; there should really be a function
w.insert_string_at_cursor(' ')
w.left_delete()
install = Text.install

View File

@ -26,3 +26,5 @@ class Text2(mode.text.Text):
'punct': ('default', 'default'),
'stuff': ('default', 'default'),
}
install = Text2.install

View File

@ -62,3 +62,5 @@ class Template(mode2.Fundamental):
self.add_bindings('close-paren', (')',))
self.add_bindings('close-brace', ('}',))
self.add_bindings('close-bracket', (']',))
install = Template.install

View File

@ -29,3 +29,5 @@ class Which(mode2.Fundamental):
self.window.application.close_mini_buffer()
self.window.buffer.method.old_cursor = None
self.window.buffer.method.old_window = None
install = Which.install

View File

@ -34,3 +34,5 @@ class XML(mode2.Fundamental):
'tag.string.end': ('green', 'default'),
'tag.end': ('default', 'default'),
}
install = XML.install

View File

@ -277,3 +277,4 @@ class Fundamental(Handler):
ghist.setdefault(name, {})
ghist[name][newp] = self.ghist[name][gp]
self.ghist = ghist
install = Fundamental.install