The documentation for the variable compilation-error-regexp-alist (in compile.el) says that the FILE parameter can also be a function that should return the filename. That is however not possible. Instead, the variable compilation-parse-errors-filename-function can be set to a function that yields the desired effect. It would be nice to have this documented in the description of the first variable. In GNU Emacs 22.2.1 (i386-mingw-nt5.1.2600) of 2008-03-26 on RELEASE Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (3.4)' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: DEU locale-coding-system: cp1252 default-enable-multibyte-characters: t Major mode: Lisp Interaction Minor modes in effect: show-paren-mode: t iswitchb-mode: t encoded-kbd-mode: t tooltip-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t unify-8859-on-encoding-mode: t utf-translate-cjk-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: M-x i e l m ( + SPC 3 SPC 3 ) C-h v c o m p i l e r . - e r r e C-g C-x C-f p l s o q - k C-s r e g e x p - a l C-n C-h v c e m o m p i l a t i o n - e r r M-x C-g C-h b s c M-x c o m p i l e - m o C-g M-x c o m p u i C-g C-h m C-h v c o m p i l a t i o n - e r r o - e r r e g X 5 2 C-x 5 2 M-x r e b p g o r t p o r t - b u Recent messages: Quit Mark saved where search started Quit [2 times] Loading compile...done Quit Making completion list... Quit Type C-x 1 to remove help window. Making completion list... Loading emacsbug...done