From: Richard M. Stallman Date: Wed, 4 Jun 2003 09:31:46 +0000 (+0000) Subject: (compilation-next-error): When moving fwd, X-Git-Tag: ttn-vms-21-2-B4~9752 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=83b5c8e0e32c9cb8ad14ffb8a8a47a0446e046cb;p=emacs.git (compilation-next-error): When moving fwd, compare position of point with the errors. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6695307260b..648dac8500d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2003-06-04 Richard M. Stallman + * 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. diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index f9ce01edd85..eebeedd1710 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -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)