changeset 24264:ffc2b7069315

(compile-mouse-goto-error): Don't lose with null markers. (compile-goto-error): Likewise.
author Dave Love <fx@gnu.org>
date Fri, 05 Feb 1999 15:19:54 +0000
parents e81f007b15fa
children c5f1a1deffbb
files lisp/progmodes/compile.el
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/compile.el	Fri Feb 05 05:40:27 1999 +0000
+++ b/lisp/progmodes/compile.el	Fri Feb 05 15:19:54 1999 +0000
@@ -1,6 +1,6 @@
 ;;; compile.el --- run compiler as inferior of Emacs, parse error messages.
 
-;; Copyright (C) 1985, 86, 87, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 86, 87, 93, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
 
 ;; Author: Roland McGrath <roland@prep.ai.mit.edu>
 ;; Maintainer: FSF
@@ -1295,7 +1295,11 @@
     ;; we want.
     (setq compilation-error-list compilation-old-error-list)
     (while (and compilation-error-list
-		(> (point) (car (car compilation-error-list))))
+		;; The marker can point nowhere if we previously
+		;; failed to find the relevant file.  See
+		;; compilation-next-error-locus.
+		(or (null (marker-buffer (caar compilation-error-list)))
+		    (> (point) (caar compilation-error-list))))
       (setq compilation-error-list (cdr compilation-error-list)))
     (or compilation-error-list
 	(error "No error to go to")))
@@ -1322,7 +1326,11 @@
   ;; we want.
   (setq compilation-error-list compilation-old-error-list)
   (while (and compilation-error-list
-	      (> (point) (car (car compilation-error-list))))
+	      ;; The marker can point nowhere if we previously
+	      ;; failed to find the relevant file.  See
+	      ;; compilation-next-error-locus.
+	      (or (null (marker-buffer (caar compilation-error-list)))
+		  (> (point) (caar compilation-error-list))))
     (setq compilation-error-list (cdr compilation-error-list)))
 
   (push-mark)