From d7870303a8e2f717314bac3e8ca728542541b83c Mon Sep 17 00:00:00 2001 From: moculus Date: Tue, 7 Apr 2009 04:34:26 +0000 Subject: [PATCH] --HG-- branch : pmacs2 --- IDEAS | 7 ++++--- mode/erlang.py | 1 + mode/forth.py | 2 ++ mode/haskell.py | 2 ++ mode/javascript.py | 2 ++ mode/lisp.py | 2 ++ mode/scheme.py | 2 ++ mode/shellmini.py | 3 +++ 8 files changed, 18 insertions(+), 3 deletions(-) diff --git a/IDEAS b/IDEAS index b79fa1e..339c488 100644 --- a/IDEAS +++ b/IDEAS @@ -1,8 +1,6 @@ 2009/04/06: -Fix all the Interact subclasses to use "resuse" when applicable. Also give -them modes subclassing mode.pipe for syntax highlighting etc. Think about what -to do with IPerl/IPython. +Think about what to do with IPerl/IPython. 2009/04/04: @@ -10,6 +8,9 @@ Rename tokens so that they follow the "c.identifier" "c.delimiter" etc. convention. This will help nested grammars work properly, and will also allow default coloring (with overrides) to work correctly. +Once tokens are namespaced by mode, try to reduce the number of "leaf names" +(e.g. identifier, keyword, builtin, etc) + Think about replacing the 'context' module with something tied into the lexing strategy. If not, then try to at least generalize it more. diff --git a/mode/erlang.py b/mode/erlang.py index b20e239..c56e436 100644 --- a/mode/erlang.py +++ b/mode/erlang.py @@ -86,6 +86,7 @@ class ErlangTabber(tab.StackTabber): ## this shit doesn't work... hmmm #class ErlStart(Interact): # args = [] +# reuse = True # def _execute(self, w, **vargs): # Interact._execute(self, w, bname='*Erl*', cmd='erl') diff --git a/mode/forth.py b/mode/forth.py index 3ec7738..3084805 100644 --- a/mode/forth.py +++ b/mode/forth.py @@ -58,11 +58,13 @@ class ForthGrammar(Grammar): class GforthStart(Interact): args = [] modename = 'forthpipe' + reuse = True def _execute(self, w, **vargs): Interact._execute(self, w, bname='*GForth*', cmd='gforth') class GforthLoadFile(Interact): args = [] modename = 'forthpipe' + reuse = True def _execute(self, w, **vargs): Interact._execute(self, w, bname='*GForth*', cmd='gforth') b = w.application.get_buffer_by_name('*GForth*') diff --git a/mode/haskell.py b/mode/haskell.py index 66347d3..1bc6ce3 100644 --- a/mode/haskell.py +++ b/mode/haskell.py @@ -42,10 +42,12 @@ class HaskellGrammar(Grammar): class HugsStart(Interact): args = [] + reuse = True def _execute(self, w, **vargs): Interact._execute(self, w, bname='*Hugs*', cmd='hugs') class HugsLoadFile(Interact): args = [] + reuse = True def _execute(self, w, **vargs): Interact._execute(self, w, bname='*Hugs*', cmd='hugs') b = w.application.get_buffer_by_name('*Hugs*') diff --git a/mode/javascript.py b/mode/javascript.py index c1ca3ce..6db58c1 100644 --- a/mode/javascript.py +++ b/mode/javascript.py @@ -89,12 +89,14 @@ class JavascriptTabber2(tab.StackTabber2): class RhinoStart(Interact): args = [] + reuse = True def _execute(self, w, **vargs): cmd = w.application.config.get('rhino.cmd', 'rhino') Interact._execute(self, w, bname='*Rhino*', cmd=cmd) class RhinoLoadFile(RhinoStart): args = [] + reuse = True def _execute(self, w, **vargs): RhinoStart._execute(self, w, **vargs) b = w.application.get_buffer_by_name('*Rhino*') diff --git a/mode/lisp.py b/mode/lisp.py index 37a7c43..db248d1 100644 --- a/mode/lisp.py +++ b/mode/lisp.py @@ -41,10 +41,12 @@ class LispTabber(StackTabber): class ClispStart(Interact): args = [] + reuse = True def _execute(self, w, **vargs): Interact._execute(self, w, bname='*Clisp*', cmd='clisp') class ClispLoadFile(Interact): args = [] + reuse = True def _execute(self, w, **vargs): Interact._execute(self, w, bname='*Clisp*', cmd='clisp') b = w.application.get_buffer_by_name('*Clisp*') diff --git a/mode/scheme.py b/mode/scheme.py index 27f2d59..529fbdd 100644 --- a/mode/scheme.py +++ b/mode/scheme.py @@ -40,11 +40,13 @@ class SchemeCheckSyntax(Method): class GuileStart(Interact): args = [] + reuse = True def _execute(self, w, **vargs): Interact._execute(self, w, bname='*Guile*', cmd='guile') class GuileLoadFile(Interact): args = [] + reuse = True def _execute(self, w, **vargs): Interact._execute(self, w, bname='*Guile*', cmd='guile') b = w.application.get_buffer_by_name('*Guile*') diff --git a/mode/shellmini.py b/mode/shellmini.py index bb7bd25..8d99f34 100644 --- a/mode/shellmini.py +++ b/mode/shellmini.py @@ -120,10 +120,13 @@ class ShellGotoEnd(ShellBaseMethod): class OpenShellRaw(method.shell.Interact): '''Evaluate sh expressions''' args = [] + reuse = True def _execute(self, w, **vargs): method.shell.Interact._execute(self, w, bname='*Shell*', cmd='bash') class OpenShell(OpenShellRaw): '''Evaluate sh expressions''' + args = [] + reuse = True def _execute(self, w, **vargs): OpenShellRaw._execute(self, w) f = lambda x: None