Thanks for the help. I still have a couple of problems though.
1) Before running the exec command I want to save the file. No problem, just make a macro. Change the binding to
<binding key="F5" command="runMacroFileSilently 'Packages/User/Runhaskell.sublime-macro'"/>
and make the macro file:
exec '^(...*?):([0-9]*):?([0-9]*)' L:/progra~1/ghc-6.8.2/bin/runhaskell.exe '"$File"'
However, pressing F5 then produces the status message "Unknown macro command exec '^(...?):([0-9]):?([0-9]*)' L:/progra~1/ghc-6.8.2/bin/runhaskell.exe '"$File"'"
I tried replacing the "s with "s, but no luck. Commenting out the line produces "Unknown macro command save". Hm. "expandSelectionTo line" works just like in the Delete Line macro, nextView produces another Unknown macro command. Are view-related commands not allowed in macros?
2) When I run the exec command directly from the keybinding everything works as expected, with one exception: The output window seems to have some sort of update problem. I have a test program that outputs one line of text of about 100 to 120 characters. After pressing F5 the output window only shows part of the line. The amount of characters printed is random. I was able to produce 3 characters, the entire string and plenty of in-between values. Clicking on the output window or switching to another application causes the entire string to be shown, so I assume this a screen update/redraw problem.
3) While the output panel is sufficient for runhaskell, which only produces output, it doesn't work for ghci, which is an interactive prompt. Therefore I still have to rely on the python script do use that one. Obviously, I need to save the file here as well. The obvious solution is to be to use
but this doesn't seem to work. After pressing F6 the asterisk behind the filename doesn't disappear. Perhaps this is related to the problem in point 1?