My situation is this: I compile by invoking a system that runs perl scripts that invoke the Visual Studio compiler, as well as running some pre-compile tasks. By and large, the system works fine.
The problem comes when something in the pre-compile step fails. There's an error, but the compilation scripts expect input (since this would've normally been run in an interactive terminal). I usually just fix the problem and hit compile again, which kills off the previous process without issue. This isn't great, though, since I don't get any notifications that the compilation has 'finished', so sometimes I don't notice that I need to restart it. (I could stare at the compilation until it finishes, but that would get on my nerves really fast.)
So I guess what would be ideal would be to parse the compilation buffer until I see "Press a key to continue" and then send some sort of input that would finish the compilation and get my compile-finished-hooks to run. I've written compilation error regexps, but is it possible to cause a matched line to call a function? Or perhaps, since the output stops, I can use that as some sort of signal?