Hi. I liked TextMate but it wasn't quite ready for me. I'll check back in on it in 2006 sometime and see how it's doing then.
In the course of my evaluation, I changed some settings to try and get closer to what I expected. I gave up when I discovered that the current approach to code folding (finding code block ends, specifically) was apparently fundamentally incompatible with Python.
However, I thought some of my changes might be worth reincorporating in your product. Some of them are arguably preferences, and others have odd dependencies, but they are at least worth a look.
First, I added an increaseIndent that increases indent on an open parenthesis:
/* preferences */ { increaseIndentPattern = '^\s*(class|def|elif|else|except|finally| for|if|try|while)\b.*:|^.*(\s*$'; shellVariables = ( { name = 'TM_COMMENT_START'; value = '# '; }, { name = 'TM_COMMENT_END'; value = ''; }, { name = 'TM_COMMENT_MODE'; value = 'line'; }, ); }
That's pretty standard Python style. I was also curious to see if I could make a line break inside a parenthesis autoindent to the open parenthesis, but didn't see a way to do that.
Second, the foldingStartMarker probably should include `if` and `for`, and maybe even some others...I didn't bother thinking about it once I got into a seeming dead end with the foldingStopMarker. That said, here's a little improvement in this part of the parsing.
foldingStartMarker = '^\s*(if|for|def|class)\s+([.a-zA-Z0-9_ b]+)\s* (((.*)))?\s*:|{\s*$|(\s*$|[\s*$';
Finally, pycheckmate didn't work for me. The first reason had something to do with using a specific Python installation, rather than the environment Python. I fixed that, and then the second problem was that the custom popen relied on poll, which wasn't included in the framework Python build. I am using ActiveState's Python2.4, so I got rid of the customization of the standard library class. The general approach I took probably would let you use some of the 2.3 popens too, and get rid of maintaining that extra bit of code.
Pycheckmate also wasn't guessing where to find an installed pychecker very well--I guess the intent was that you were supposed to configure the environment variable in TextMate. That seemed unnecessary for the common case of installing via distutils. I fixed that at the start of the attached file--a bit of a hack, maybe, but nicer first- use experience.
Hope some of that is helpful.
Gary
In the course of my evaluation, I changed some settings to try and get closer to what I expected. I gave up when I discovered that the current approach to code folding (finding code block ends, specifically) was apparently fundamentally incompatible with Python.
I'm pretty sure someday TM will support code folding purely based on indentation. There's a script bound to cmd+shift+V that modifies the indentation of blank lines to make folding work 99% of the time, you just press it and the little arrows rearrange nicely :)
That's pretty standard Python style. I was also curious to see if I could make a line break inside a parenthesis autoindent to the open parenthesis, but didn't see a way to do that.
that's possible but quite... er... nasty. you'd have to create a command that finds the position of the last unmatched parenthesis and inserts NL and a congruous number of spaces, then bind it to the enter key. one day I'll hack on it.
Finally, pycheckmate didn't work for me. The first reason had something to do with using a specific Python installation, rather than the environment Python. I fixed that, and then the second problem was that the custom popen relied on poll, which wasn't included in the framework Python build.
you want to check the new version which fixes that (it was committed like two days ago IIRC)
Pycheckmate also wasn't guessing where to find an installed pychecker very well--I guess the intent was that you were supposed to configure the environment variable in TextMate. That seemed unnecessary for the common case of installing via distutils. I fixed that at the start of the attached file--a bit of a hack, maybe, but nicer first-use experience.
I'll forward your changes to Jay Soffian for merging.
bye,
Domenico -- Official Python Advocate of the ##textmate Channel.