I took a look at the manual entry for compilation-mode, which contains: Sometimes ‘compilation-error-regexp-alist’ doesn't correctly determine the filename that is the source of the error. Use user option ‘compilation-transform-file-match-alist’ to make any necessary adjustments, such as adding or changing a directory component, or even considering certain compiler messages not error messages at all. This suggests a surgical fix (attached) that addresses the cases of the bug that I had been able to reproduce. Perhaps Johann can check if it addresses his cases, too.