changeset 71878:30e3082c1a7e

(gud-display-line): Use gdb-display-buffer. Set gdb-source-window.
author Nick Roberts <nickrob@snap.net.nz>
date Thu, 13 Jul 2006 21:57:05 +0000
parents 28ec37c2aa2c
children d236eeffa8f7
files lisp/progmodes/gud.el
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/gud.el	Thu Jul 13 21:56:26 2006 +0000
+++ b/lisp/progmodes/gud.el	Thu Jul 13 21:57:05 2006 +0000
@@ -2763,7 +2763,8 @@
 	    (gud-find-file true-file)))
 	 (window (and buffer (or (get-buffer-window buffer)
 				 (if (memq gud-minor-mode '(gdbmi gdba))
-				     (gdb-display-source-buffer buffer))
+				     (unless (gdb-display-source-buffer buffer)
+				       (gdb-display-buffer buffer nil)))
 				 (display-buffer buffer))))
 	 (pos))
     (if buffer
@@ -2793,7 +2794,10 @@
 	    (cond ((or (< pos (point-min)) (> pos (point-max)))
 		   (widen)
 		   (goto-char pos))))
-	  (if window (set-window-point window gud-overlay-arrow-position))))))
+	  (when window 
+	    (set-window-point window gud-overlay-arrow-position)
+	    (if (memq gud-minor-mode '(gdbmi gdba))
+		(setq gdb-source-window window)))))))
 
 ;; The gud-call function must do the right thing whether its invoking
 ;; keystroke is from the GUD buffer itself (via major-mode binding)