aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorChong Yidong2012-05-13 17:16:46 +0800
committerChong Yidong2012-05-13 17:16:46 +0800
commit6cb820bab5c5ed552baa4deebee870ceda3738db (patch)
tree0c92ee460e8149ee7fd82aa58aace5ff00dbe0a9 /lisp/progmodes
parent9879e263b19070518b6e45f71daaaf7e7021cdbd (diff)
downloademacs-6cb820bab5c5ed552baa4deebee870ceda3738db.tar.gz
emacs-6cb820bab5c5ed552baa4deebee870ceda3738db.zip
Backport fix for Bug#11382 from trunk
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/compile.el18
1 files changed, 9 insertions, 9 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index c1d8f9db23f..cdaff413444 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1068,14 +1068,14 @@ FMTS is a list of format specs for transforming the file name.
1068 end-marker loc end-loc) 1068 end-marker loc end-loc)
1069 (if (not (and marker (marker-buffer marker))) 1069 (if (not (and marker (marker-buffer marker)))
1070 (setq marker nil) ; no valid marker for this file 1070 (setq marker nil) ; no valid marker for this file
1071 (setq loc (or line 1)) ; normalize no linenumber to line 1 1071 (unless line (setq line 1)) ; normalize no linenumber to line 1
1072 (catch 'marker ; find nearest loc, at least one exists 1072 (catch 'marker ; find nearest loc, at least one exists
1073 (dolist (x (cddr (compilation--file-struct->loc-tree 1073 (dolist (x (cddr (compilation--file-struct->loc-tree
1074 file-struct))) ; Loop over remaining lines. 1074 file-struct))) ; Loop over remaining lines.
1075 (if (> (car x) loc) ; Still bigger. 1075 (if (> (car x) line) ; Still bigger.
1076 (setq marker-line x) 1076 (setq marker-line x)
1077 (if (> (- (or (car marker-line) 1) loc) 1077 (if (> (- (or (car marker-line) 1) line)
1078 (- loc (car x))) ; Current line is nearer. 1078 (- line (car x))) ; Current line is nearer.
1079 (setq marker-line x)) 1079 (setq marker-line x))
1080 (throw 'marker t)))) 1080 (throw 'marker t))))
1081 (setq marker (compilation--loc->marker (cadr marker-line)) 1081 (setq marker (compilation--loc->marker (cadr marker-line))
@@ -1093,15 +1093,15 @@ FMTS is a list of format specs for transforming the file name.
1093 (save-restriction 1093 (save-restriction
1094 (widen) 1094 (widen)
1095 (goto-char (marker-position marker)) 1095 (goto-char (marker-position marker))
1096 (when (or end-col end-line) 1096 ;; Set end-marker if appropriate and go to line.
1097 (if (not (or end-col end-line))
1098 (beginning-of-line (- line marker-line -1))
1097 (beginning-of-line (- (or end-line line) marker-line -1)) 1099 (beginning-of-line (- (or end-line line) marker-line -1))
1098 (if (or (null end-col) (< end-col 0)) 1100 (if (or (null end-col) (< end-col 0))
1099 (end-of-line) 1101 (end-of-line)
1100 (compilation-move-to-column end-col screen-columns)) 1102 (compilation-move-to-column end-col screen-columns))
1101 (setq end-marker (point-marker))) 1103 (setq end-marker (point-marker))
1102 (beginning-of-line (if end-line 1104 (when end-line (beginning-of-line (- line end-line -1))))
1103 (- line end-line -1)
1104 (- loc marker-line -1)))
1105 (if col 1105 (if col
1106 (compilation-move-to-column col screen-columns) 1106 (compilation-move-to-column col screen-columns)
1107 (forward-to-indentation 0)) 1107 (forward-to-indentation 0))