Commit 6cb820ba authored by Chong Yidong's avatar Chong Yidong
Browse files

Backport fix for Bug#11382 from trunk

parent 9879e263
2012-05-06 Troels Nielsen <bn.troels@gmail.com> (tiny change)
* progmodes/compile.el (compilation-internal-error-properties):
Calculate start position correctly when end-col is set but
end-line is not (Bug#11382).
2012-05-11 Stefan Monnier <monnier@iro.umontreal.ca> 2012-05-11 Stefan Monnier <monnier@iro.umontreal.ca>
* net/rlogin.el (rlogin-mode-map): Fix last change. * net/rlogin.el (rlogin-mode-map): Fix last change.
......
...@@ -1068,14 +1068,14 @@ FMTS is a list of format specs for transforming the file name. ...@@ -1068,14 +1068,14 @@ FMTS is a list of format specs for transforming the file name.
end-marker loc end-loc) end-marker loc end-loc)
(if (not (and marker (marker-buffer marker))) (if (not (and marker (marker-buffer marker)))
(setq marker nil) ; no valid marker for this file (setq marker nil) ; no valid marker for this file
(setq loc (or line 1)) ; normalize no linenumber to line 1 (unless line (setq line 1)) ; normalize no linenumber to line 1
(catch 'marker ; find nearest loc, at least one exists (catch 'marker ; find nearest loc, at least one exists
(dolist (x (cddr (compilation--file-struct->loc-tree (dolist (x (cddr (compilation--file-struct->loc-tree
file-struct))) ; Loop over remaining lines. file-struct))) ; Loop over remaining lines.
(if (> (car x) loc) ; Still bigger. (if (> (car x) line) ; Still bigger.
(setq marker-line x) (setq marker-line x)
(if (> (- (or (car marker-line) 1) loc) (if (> (- (or (car marker-line) 1) line)
(- loc (car x))) ; Current line is nearer. (- line (car x))) ; Current line is nearer.
(setq marker-line x)) (setq marker-line x))
(throw 'marker t)))) (throw 'marker t))))
(setq marker (compilation--loc->marker (cadr marker-line)) (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,15 +1093,15 @@ FMTS is a list of format specs for transforming the file name.
(save-restriction (save-restriction
(widen) (widen)
(goto-char (marker-position marker)) (goto-char (marker-position marker))
(when (or end-col end-line) ;; Set end-marker if appropriate and go to line.
(if (not (or end-col end-line))
(beginning-of-line (- line marker-line -1))
(beginning-of-line (- (or end-line line) marker-line -1)) (beginning-of-line (- (or end-line line) marker-line -1))
(if (or (null end-col) (< end-col 0)) (if (or (null end-col) (< end-col 0))
(end-of-line) (end-of-line)
(compilation-move-to-column end-col screen-columns)) (compilation-move-to-column end-col screen-columns))
(setq end-marker (point-marker))) (setq end-marker (point-marker))
(beginning-of-line (if end-line (when end-line (beginning-of-line (- line end-line -1))))
(- line end-line -1)
(- loc marker-line -1)))
(if col (if col
(compilation-move-to-column col screen-columns) (compilation-move-to-column col screen-columns)
(forward-to-indentation 0)) (forward-to-indentation 0))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment