changeset 52329:06717a26a254

(gud-display-line): Don't set window-point if source buffer is not visible. (Only happens with M-x gdba).
author Nick Roberts <nickrob@snap.net.nz>
date Sun, 24 Aug 2003 20:41:39 +0000
parents 06d74a21fa32
children 40544f522d02
files lisp/progmodes/gud.el
diffstat 1 files changed, 7 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/gud.el	Sun Aug 24 20:40:03 2003 +0000
+++ b/lisp/progmodes/gud.el	Sun Aug 24 20:41:39 2003 +0000
@@ -2524,26 +2524,24 @@
     (if buffer
 	(progn
 	  (with-current-buffer buffer
-	    (if (not (or (verify-visited-file-modtime buffer) gud-keep-buffer))
-		(progn
-		  (if
-		      (yes-or-no-p
+	    (unless (or (verify-visited-file-modtime buffer) gud-keep-buffer)
+		  (if (yes-or-no-p
 		       (format "File %s changed on disk.  Reread from disk? "
 			       (buffer-name)))
 		      (revert-buffer t t)
-		    (setq gud-keep-buffer t))))
+		    (setq gud-keep-buffer t)))
 	    (save-restriction
 	      (widen)
 	      (goto-line line)
 	      (setq pos (point))
 	      (setq overlay-arrow-string "=>")
 	      (or overlay-arrow-position
-	      (setq overlay-arrow-position (make-marker)))
+		  (setq overlay-arrow-position (make-marker)))
 	      (set-marker overlay-arrow-position (point) (current-buffer)))
 	    (cond ((or (< pos (point-min)) (> pos (point-max)))
-	    (widen)
-	    (goto-char pos))))
-	  (set-window-point window overlay-arrow-position)))))
+		   (widen)
+		   (goto-char pos))))
+	  (if window (set-window-point window overlay-arrow-position))))))
 
 ;; The gud-call function must do the right thing whether its invoking
 ;; keystroke is from the GUD buffer itself (via major-mode binding)