diff options
| author | Chong Yidong | 2012-05-13 17:16:46 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-05-13 17:16:46 +0800 |
| commit | 6cb820bab5c5ed552baa4deebee870ceda3738db (patch) | |
| tree | 0c92ee460e8149ee7fd82aa58aace5ff00dbe0a9 | |
| parent | 9879e263b19070518b6e45f71daaaf7e7021cdbd (diff) | |
| download | emacs-6cb820bab5c5ed552baa4deebee870ceda3738db.tar.gz emacs-6cb820bab5c5ed552baa4deebee870ceda3738db.zip | |
Backport fix for Bug#11382 from trunk
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/progmodes/compile.el | 18 |
2 files changed, 15 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e6183d92705..93127c43783 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2012-05-06 Troels Nielsen <bn.troels@gmail.com> (tiny change) | ||
| 2 | |||
| 3 | * progmodes/compile.el (compilation-internal-error-properties): | ||
| 4 | Calculate start position correctly when end-col is set but | ||
| 5 | end-line is not (Bug#11382). | ||
| 6 | |||
| 1 | 2012-05-11 Stefan Monnier <monnier@iro.umontreal.ca> | 7 | 2012-05-11 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 8 | ||
| 3 | * net/rlogin.el (rlogin-mode-map): Fix last change. | 9 | * net/rlogin.el (rlogin-mode-map): Fix last change. |
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)) |