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 <return> ( + SPC 3 SPC 3 ) <return> C-h v c o m p i l e r <tab> <backspace> <tab> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <tab> <tab> <tab> . - e r r <tab> <tab> <tab> <backspace> <backspace> <backspace> <backspace> <backspace> e <tab>
<tab> <tab> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> C-g <help-echo> C-x C-f p l s o <tab> <backspace> q <tab> - k <tab> <return> C-s r e g e x p - a l <help-echo> <help-echo> C-n C-h v c e m <backspace> <backspace>
o m p i l a t i o n - e r r <tab> <tab> <tab> <tab> <tab> <tab> <tab> <tab> <tab> <tab> <tab> <tab> <tab> <tab> <tab> M-x C-g C-h b s c <return> M-x c o m p
i l e <tab> - <tab> <backspace> <backspace> <backspace> <backspace> <backspace> m o <tab> <return> <backspace> <backspace> <tab> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <return> C-g M-x c o m p u <backspace> i <tab> <tab> <tab> C-g C-h m C-h v c o m p <tab> i l a t i o n - e r r o <tab> -
e r <backspace> <backspace> r e g <tab> <return> <help-echo> X 5 2 <backspace> <backspace> <backspace> C-x 5 2 <switch-frame> M-x r e b p <backspace> <backspace> g o r t <backspace>
<backspace> <backspace> <backspace> p o r t - b u <tab> <backspace> <tab> <backspace> <tab> <return>
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