]> git.eshelyaron.com Git - emacs.git/commitdiff
(compilation-next-error): When moving fwd,
authorRichard M. Stallman <rms@gnu.org>
Wed, 4 Jun 2003 09:31:46 +0000 (09:31 +0000)
committerRichard M. Stallman <rms@gnu.org>
Wed, 4 Jun 2003 09:31:46 +0000 (09:31 +0000)
compare position of point with the errors.

lisp/ChangeLog
lisp/progmodes/compile.el

index 6695307260b67d9326b8a258062e5d46a84c8a23..648dac8500de58dee35298b7446414b3f28ac8a0 100644 (file)
@@ -1,5 +1,8 @@
 2003-06-04  Richard M. Stallman  <rms@gnu.org>
 
+       * progmodes/compile.el (compilation-next-error): When moving fwd,
+       compare position of point with the errors.
+
        * dired.el (dired-get-filename): Err for . and .. in usual case.
        (dired-get-file-for-visit): Specify no-error to dired-get-filename,
        and check for real errors here.
index f9ce01edd8589bff1173b1bd7539046311cd66e8..eebeedd1710f7b81d21309a3981960b8f7dde33f 100644 (file)
@@ -1407,7 +1407,18 @@ Does NOT find the source line like \\[next-error]."
                          (if (> (- n) i)
                              (error "Moved back past first error")
                            (nth (+ i n) compilation-old-error-list)))
-                     (let ((compilation-error-list (cdr errors)))
+                     (save-excursion
+                       (while (> n 0)
+                         ;; Discard the current error and any previous.
+                         (while (>= (point) (car (car errors)))
+                           (setq errors (cdr errors)))
+                         ;; Now (car errors) is the next error.
+                         ;; If we want to move down more errors,
+                         ;; put point at this one and start again.
+                         (setq n (1- n))
+                         (if (and errors (> n 0))
+                             (goto-char (car (car errors))))))
+                     (let ((compilation-error-list errors))
                        (compile-reinitialize-errors nil nil n)
                        (if compilation-error-list
                            (nth (1- n) compilation-error-list)