From fe680f26dccc4ecae47449284a85c198dfd97695 Mon Sep 17 00:00:00 2001 From: Erik Osheim Date: Thu, 30 Sep 2010 18:18:57 -0400 Subject: [PATCH] updates --HG-- branch : pmacs2 --- application.py | 3 ++- method/svn.py | 2 ++ mode/rst.py | 4 +++- mode/scala.py | 6 ++++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/application.py b/application.py index 5c4756b..cbbd448 100755 --- a/application.py +++ b/application.py @@ -444,7 +444,8 @@ class Application(object): raise FileError("not a file or dir: %r" % path) try: b.open() - except buffer.BinaryDataException: + #except buffer.BinaryDataException: + except: if binary: raise else: diff --git a/method/svn.py b/method/svn.py index da10943..bee52f2 100644 --- a/method/svn.py +++ b/method/svn.py @@ -150,6 +150,8 @@ class SvnLog(Method): mesg_data = '\n'.join(mesg_lines).strip() if mesg_data: mesg_data += '\n' + mesg_data = mesg_data.replace('[', '\\[') + mesg_data = mesg_data.replace(']', '\\]') return '[b:d:*]' + log_data + '\n' + mesg_data def _execute(self, w, **vargs): cmd = "svn log %r" % w.buffer.path diff --git a/mode/rst.py b/mode/rst.py index 07df8b4..70fde25 100644 --- a/mode/rst.py +++ b/mode/rst.py @@ -31,7 +31,9 @@ class RSTGrammar(Grammar): PatternRule(r'reference', r'[a-zA-Z]+_(?![a-zA-Z0-9_])'), RegionRule(r'inline_internal', r'_`', RSTString2, r'`'), - RegionRule(r'substitution', r'\|(?! )', RSTString3, r'\|'), + #RegionRule(r'substitution', r'\|(?! )', RSTString3, r'\|'), + PatternRule('substitution', r'r\|[^ ]+\|'), + #RegionRule(r'substitution', r'\|(?! )', RSTString3, r'\|'), PatternRule(r'footnote', r'\[[0-9]+\]_'), PatternRule(r'citation', r'\[.+?\]_'), PatternRule(r'rst_url', r'http://[^ ]+'), diff --git a/mode/scala.py b/mode/scala.py index d2e0ab1..7224bf4 100644 --- a/mode/scala.py +++ b/mode/scala.py @@ -1,6 +1,7 @@ from tab import StackTabber2 from mode import Fundamental from lex import Grammar, PatternRule, RegionRule, PatternMatchRule +from mode.sh import ShGrammar from mode.xml import XMLGrammar from mode.pipe import Pipe from method.shell import Interact @@ -36,6 +37,7 @@ class ScalaGrammar(Grammar): rules = [ PatternRule('scala.comment', '//.*$'), RegionRule('scala.comment', r'/\*', NestedCommentGrammar, r'\*/'), + RegionRule('scala.script', r'#!.+$', ShGrammar, r'!#'), PatternMatchRule('x', r'(?<=[a-zA-Z0-9_ ])(:)([a-zA-Z0-9_]+)', 'delimiter', 'scala.type'), @@ -72,6 +74,7 @@ class ScalaGrammar(Grammar): PatternRule('scala.float', r'-?[0-9]+\.[0-9]*'), # FIXME PatternRule('scala.char', r"'(?:[^'\\]|\\u[0-9A-Fa-f]{4}|\\[0-7]{1,3}|\\[btnfr\"'\\])'"), + RegionRule('scala.string', '"""', Grammar, '"""'), RegionRule('scala.string', '"', StringGrammar, '"'), PatternRule('scala.symbol', "'[a-zA-Z_][a-zA-Z0-9_]*"), @@ -206,6 +209,9 @@ class Scala(Fundamental): } colors = { + 'scala.script.start': hi_red, + 'scala.script.end': hi_red, + 'scala.annotation': lo_green, 'scala.pseudo': hi_magenta,