With the buffer having the contents shown below, 1. Enable flymake-mode. 2. Narrow from the top of the buffer down to the indicated comment. 3. Execute flymake-start. You should get an error "error in process sentinel: Wrong type argument: integer-or-marker-p, nil". I suspect perl-flymake has similar issues so you might want to check that out as well. Buffer contents: \documentclass{article} \begin{document} 0 a b c % <----- End narrow d e f g h i j{ \end{document}