diff options
author | Roland McGrath <[email protected]> | 1994-01-06 17:21:32 +0000 |
---|---|---|
committer | Roland McGrath <[email protected]> | 1994-01-06 17:21:32 +0000 |
commit | 1e0e614d5ebfd2fb750a4a001f588673b605a8b5 (patch) | |
tree | 21d3b5af86eadd70f1e684e315ccb5c1f34cf33a /lisp/progmodes | |
parent | 3db9a4ebb4a0a2730428dca65bd30fdcc352b49c (diff) |
(compilation-parse-errors): Prepend comint-file-name-prefix (if boundp) to
absolute file names culled from error msgs.
(compile-abbreviate-directory): Prepend comint-file-name-prefix (if boundp)
to DIR before other processing.
Diffstat (limited to 'lisp/progmodes')
-rw-r--r-- | lisp/progmodes/compile.el | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 5da647185f..684d741ae1 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1114,10 +1114,8 @@ See variable `compilation-parse-errors-function' for the interface it uses." ;; Extract the file name and line number from the error message. (let ((beginning-of-match (match-beginning 0)) ;looking-at nukes - (filename - (cons default-directory - (buffer-substring (match-beginning (nth 1 alist)) - (match-end (nth 1 alist))))) + (filename (buffer-substring (match-beginning (nth 1 alist)) + (match-end (nth 1 alist)))) (linenum (save-restriction (narrow-to-region (match-beginning (nth 2 alist)) @@ -1125,6 +1123,17 @@ See variable `compilation-parse-errors-function' for the interface it uses." (goto-char (point-min)) (if (looking-at "[0-9]") (read (current-buffer)))))) + ;; Check for a comint-file-name-prefix and prepend it if + ;; appropriate. (This is very useful for + ;; compilation-minor-mode in an rlogin-mode buffer.) + (and (boundp 'comint-file-name-prefix) + ;; If the file name is relative, default-directory will + ;; already contain the comint-file-name-prefix (done by + ;; compile-abbreviate-directory). + (file-name-absolute-p filename) + (setq filename (concat comint-file-name-prefix filename))) + (setq filename (cons default-directory filename)) + ;; Locate the erring file and line. ;; Cons a new elt onto compilation-error-list, ;; giving a marker for the current compilation buffer @@ -1191,6 +1200,12 @@ See variable `compilation-parse-errors-function' for the interface it uses." ;; Those two args could be computed here, but we run faster by ;; having the caller compute them just once. (defun compile-abbreviate-directory (dir orig orig-expanded parent-expanded) + ;; Check for a comint-file-name-prefix and prepend it if appropriate. + ;; (This is very useful for compilation-minor-mode in an rlogin-mode + ;; buffer.) + (if (boundp 'comint-file-name-prefix) + (setq dir (concat comint-file-name-prefix dir))) + (if (and (> (length dir) (length orig-expanded)) (string= orig-expanded (substring dir 0 (length orig-expanded)))) |