aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland McGrath1994-01-06 17:21:32 +0000
committerRoland McGrath1994-01-06 17:21:32 +0000
commit1e0e614d5ebfd2fb750a4a001f588673b605a8b5 (patch)
tree21d3b5af86eadd70f1e684e315ccb5c1f34cf33a
parent3db9a4ebb4a0a2730428dca65bd30fdcc352b49c (diff)
downloademacs-1e0e614d5ebfd2fb750a4a001f588673b605a8b5.tar.gz
emacs-1e0e614d5ebfd2fb750a4a001f588673b605a8b5.zip
(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.
-rw-r--r--lisp/progmodes/compile.el23
1 files changed, 19 insertions, 4 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 5da647185fe..684d741ae1f 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."
1114 1114
1115 ;; Extract the file name and line number from the error message. 1115 ;; Extract the file name and line number from the error message.
1116 (let ((beginning-of-match (match-beginning 0)) ;looking-at nukes 1116 (let ((beginning-of-match (match-beginning 0)) ;looking-at nukes
1117 (filename 1117 (filename (buffer-substring (match-beginning (nth 1 alist))
1118 (cons default-directory 1118 (match-end (nth 1 alist))))
1119 (buffer-substring (match-beginning (nth 1 alist))
1120 (match-end (nth 1 alist)))))
1121 (linenum (save-restriction 1119 (linenum (save-restriction
1122 (narrow-to-region 1120 (narrow-to-region
1123 (match-beginning (nth 2 alist)) 1121 (match-beginning (nth 2 alist))
@@ -1125,6 +1123,17 @@ See variable `compilation-parse-errors-function' for the interface it uses."
1125 (goto-char (point-min)) 1123 (goto-char (point-min))
1126 (if (looking-at "[0-9]") 1124 (if (looking-at "[0-9]")
1127 (read (current-buffer)))))) 1125 (read (current-buffer))))))
1126 ;; Check for a comint-file-name-prefix and prepend it if
1127 ;; appropriate. (This is very useful for
1128 ;; compilation-minor-mode in an rlogin-mode buffer.)
1129 (and (boundp 'comint-file-name-prefix)
1130 ;; If the file name is relative, default-directory will
1131 ;; already contain the comint-file-name-prefix (done by
1132 ;; compile-abbreviate-directory).
1133 (file-name-absolute-p filename)
1134 (setq filename (concat comint-file-name-prefix filename)))
1135 (setq filename (cons default-directory filename))
1136
1128 ;; Locate the erring file and line. 1137 ;; Locate the erring file and line.
1129 ;; Cons a new elt onto compilation-error-list, 1138 ;; Cons a new elt onto compilation-error-list,
1130 ;; giving a marker for the current compilation buffer 1139 ;; giving a marker for the current compilation buffer
@@ -1191,6 +1200,12 @@ See variable `compilation-parse-errors-function' for the interface it uses."
1191;; Those two args could be computed here, but we run faster by 1200;; Those two args could be computed here, but we run faster by
1192;; having the caller compute them just once. 1201;; having the caller compute them just once.
1193(defun compile-abbreviate-directory (dir orig orig-expanded parent-expanded) 1202(defun compile-abbreviate-directory (dir orig orig-expanded parent-expanded)
1203 ;; Check for a comint-file-name-prefix and prepend it if appropriate.
1204 ;; (This is very useful for compilation-minor-mode in an rlogin-mode
1205 ;; buffer.)
1206 (if (boundp 'comint-file-name-prefix)
1207 (setq dir (concat comint-file-name-prefix dir)))
1208
1194 (if (and (> (length dir) (length orig-expanded)) 1209 (if (and (> (length dir) (length orig-expanded))
1195 (string= orig-expanded 1210 (string= orig-expanded
1196 (substring dir 0 (length orig-expanded)))) 1211 (substring dir 0 (length orig-expanded))))