Tip for Writing Macros for jEdit with Jython
Don't use the following idiom:
data = open('foo.txt').read()
...
Instead, do:
f = open('foo.txt')
data = f.read()
f.close()
This is important if you're working with files that jEdit has open, as Jython may still have the file open when you attempt to save it with jEdit. If this happens, you may be unable to save your file in jEdit. I learned this the hard way.