]> git.eshelyaron.com Git - emacs.git/commitdiff
(compilation-parse-errors-filename-function):
authorGerd Moellmann <gerd@gnu.org>
Thu, 25 Oct 2001 07:47:48 +0000 (07:47 +0000)
committerGerd Moellmann <gerd@gnu.org>
Thu, 25 Oct 2001 07:47:48 +0000 (07:47 +0000)
New variable.
(compilation-parse-errors): Use it.

lisp/progmodes/compile.el

index f520d8600689bf7bf011b80f0264ade51231746d..34dc39370ca84e6bd89a0b1a039db7d105b195e6 100644 (file)
@@ -1,6 +1,7 @@
 ;;; compile.el --- run compiler as inferior of Emacs, parse error messages
 
-;; Copyright (C) 1985, 86, 87, 93, 94, 95, 96, 97, 98, 1999, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 86, 87, 93, 94, 95, 96, 97, 98, 1999, 2001
+;;  Free Software Foundation, Inc.
 
 ;; Author: Roland McGrath <roland@gnu.org>
 ;; Maintainer: FSF
@@ -133,6 +134,11 @@ It should read in the source files which have errors and set
 `compilation-error-list' to a list with an element for each error message
 found.  See that variable for more info.")
 
+(defvar compilation-parse-errors-filename-function nil
+  "Function to call to post-process filenames while parsing error messages.
+It takes one arg FILENAME which is the name of a file as found
+in the compilation output, and should return a transformed file name.")
+
 ;;;###autoload
 (defvar compilation-process-setup-function nil
   "*Function to call to customize the compilation process.
@@ -1944,6 +1950,13 @@ An error message with no file name and no file name has been seen earlier"))
                         (setq filename
                               (concat comint-file-name-prefix filename)))
 
+                   ;; If compilation-parse-errors-filename-function is
+                   ;; defined, use it to process the filename.
+                   (when compilation-parse-errors-filename-function
+                     (setq filename
+                           (funcall compilation-parse-errors-filename-function
+                                    filename)))
+
                    ;; Some compilers (e.g. Sun's java compiler, reportedly)
                    ;; produce bogus file names like "./bar//foo.c" for file
                    ;; "bar/foo.c"; expand-file-name will collapse these into