# HG changeset patch # User Richard M. Stallman # Date 1054719098 0 # Node ID e21c970a414e2991fa7aa7bc623c40e2e0d65768 # Parent 75df22371834d7955ca20e0fed15121cca0a3aa1 (compilation-next-error): When moving fwd, compare position of point with the errors. diff -r 75df22371834 -r e21c970a414e lisp/progmodes/compile.el --- a/lisp/progmodes/compile.el Wed Jun 04 09:30:10 2003 +0000 +++ b/lisp/progmodes/compile.el Wed Jun 04 09:31:38 2003 +0000 @@ -1407,7 +1407,18 @@ (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)