> Often compilation-mode displays wrong number of errors > in the mode-line even when compilation is finished. > > compilation-mode is based on font-lock, so when the > *compilation* buffer is not displayed during compilation, > some parts of this buffer that contain error messages > are not fontified, and thus these errors are not counted. > > This patch ensures the correct number of errors > is displayed on the mode-line: Actually maybe better to count errors not at the end of compilation, but during compilation as output goes: