Will you also have a look at the lexer itself and see if you can find out why it loops for the inputs from the mentioned issues? It's important for applications that pygments doesn't loop with any input for any lexer :)
Georg Brandl I've fixed the lexer looping problem, made the text analyser friendlier to other languages, and I even fixed a highlighting bug. New commits for you in the request!
Also, I looked over my commits, and noticed a bunch of commits whose contents are pretty much discarded right away (the analysis heuristic stuff). I get the impression that Hg users prefer not to mess with history once it's been written, but I thought I would get your opinion. Would you like me to clean the commits (or code) up in any way?