 <p>I think what you want to customize is <code>compilation-parse-errors-filename-function</code>, which is a function that takes a filename, and returns a modified version of the filename to be displayed. This is a buffer local variable, so you should set it in each buffer that will be displaying python errors (there is probably an appropriate hook to use, I do not have python mode installed so I cannot look it up). You would use <code>propertize</code> to return a version of the input filename that acts as a hyperlink to load the actual file. propertize is well documented in the elisp manual.</p> <p>If compilation-parse-errors-filename-function is not getting called, then you want to add a list to <code>compilation-error-regexp-alist-alist</code> (that does say alist-alist, that is not a typo) which is a list of mode names followed by regular expressions to match errors, and numerical indexes of the matching line number, filename etc. info in the error regexp match.</p>