goto-errorfunctions, which are incredibly useful.
goto-erroris the function that lets you hit enter on a line from a stack trace and wind up looking at that line in that file. That's far more useful than just colorful stuff.
goto-erroruses text properties to determine whether there's an error on that line or not, so turning off font-lock-mode turns off
goto-error. Thus, font-lock-mode must stay on. However,
ansi-color-applygives you text with its 'face' property set, and font-lock-mode overwrites the 'face' property when it fontifies the buffer.
There's a way out, though: font-lock-mode leaves the 'font-lock-face' property alone, and if your text has 'font-lock-face' set, then that acts like its 'face' property.
So all we have to do is take the output of
ansi-color-apply, turn its 'face' property into 'font-lock-face', and make *that* the string that
(defadvice compilation-filter (before ansify-compilation-output activate)
(with-current-buffer (process-buffer (ad-get-arg 0))
(let ((colorstr (ansi-color-apply (ad-get-arg 1))))
(ad-set-arg 1 (font-lock-proof colorstr 0)))))
(defun font-lock-proof (string start)
((>= start (length string)) "")
(let* ((end (next-property-change start string (length string)))
(s (substring string start end)))
(substitute 'font-lock-face 'face (text-properties-at 0 s))
(concat s (font-lock-proof string end))))))
(fancy highlighted code courtesy of htmlize.el)