emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r108138: Fix match highlighting in co


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r108138: Fix match highlighting in compilation buffers.
Date: Sun, 06 May 2012 12:52:58 +0800
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 108138
fixes bug(s): http://debbugs.gnu.org/11382
author: Troels Nielsen <address@hidden>
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sun 2012-05-06 12:52:58 +0800
message:
  Fix match highlighting in compilation buffers.
  
  * progmodes/compile.el (compilation-internal-error-properties):
  Calculate start position correctly when end-col is set but
  end-line is not.
modified:
  lisp/ChangeLog
  lisp/progmodes/compile.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-05-06 04:19:11 +0000
+++ b/lisp/ChangeLog    2012-05-06 04:52:58 +0000
@@ -1,3 +1,9 @@
+2012-05-06  Troels Nielsen  <address@hidden>  (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-06  Wolfgang Jenkner  <address@hidden>
 
        * man.el (Man-unindent): Use text-property-default-nonsticky to

=== modified file 'lisp/progmodes/compile.el'
--- a/lisp/progmodes/compile.el 2012-05-04 23:16:47 +0000
+++ b/lisp/progmodes/compile.el 2012-05-06 04:52:58 +0000
@@ -1068,14 +1068,14 @@
         end-marker loc end-loc)
     (if (not (and marker (marker-buffer marker)))
        (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
        (dolist (x (cddr (compilation--file-struct->loc-tree
                           file-struct)))       ; Loop over remaining lines.
-         (if (> (car x) loc)           ; Still bigger.
+         (if (> (car x) line)          ; Still bigger.
              (setq marker-line x)
-           (if (> (- (or (car marker-line) 1) loc)
-                  (- loc (car x)))     ; Current line is nearer.
+           (if (> (- (or (car marker-line) 1) line)
+                  (- line (car x)))    ; Current line is nearer.
                (setq marker-line x))
            (throw 'marker t))))
       (setq marker (compilation--loc->marker (cadr marker-line))
@@ -1093,15 +1093,15 @@
          (save-restriction
            (widen)
            (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))
              (if (or (null end-col) (< end-col 0))
                  (end-of-line)
                (compilation-move-to-column end-col screen-columns))
-             (setq end-marker (point-marker)))
-           (beginning-of-line (if end-line
-                                  (- line end-line -1)
-                                (- loc marker-line -1)))
+             (setq end-marker (point-marker))
+             (when end-line (beginning-of-line (- line end-line -1))))
            (if col
                (compilation-move-to-column col screen-columns)
              (forward-to-indentation 0))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]