changeset 78931:4c662e5e1263

(gud-display-line): Find source buffer even when GUD buffer has it's own frame.
author Nick Roberts <nickrob@snap.net.nz>
date Mon, 01 Oct 2007 11:28:21 +0000
parents 6bf33e79e3cf
children 4b81b4e0cdf6
files lisp/progmodes/gud.el
diffstat 1 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/gud.el	Mon Oct 01 11:26:43 2007 +0000
+++ b/lisp/progmodes/gud.el	Mon Oct 01 11:28:21 2007 +0000
@@ -2630,7 +2630,7 @@
 	   ;;  process-buffer is current-buffer
 	   (unwind-protect
 	       (progn
-		 ;; Write something in *compilation* and hack its mode line,
+		 ;; Write something in the GUD buffer and hack its mode line,
 		 (set-buffer (process-buffer proc))
 		 ;; Fix the mode line.
 		 (setq mode-line-process
@@ -2686,11 +2686,14 @@
 	 (buffer
 	  (with-current-buffer gud-comint-buffer
 	    (gud-find-file true-file)))
-	 (window (and buffer (or (get-buffer-window buffer)
-				 (if (memq gud-minor-mode '(gdbmi gdba))
-				     (unless (gdb-display-source-buffer buffer)
-				       (gdb-display-buffer buffer nil)))
-				 (display-buffer buffer))))
+	 (window (and buffer
+		      (or (get-buffer-window buffer)
+			  (if (memq gud-minor-mode '(gdbmi gdba))
+			      (or (if (get-buffer-window buffer 0)
+				      (display-buffer buffer nil 0))
+				  (unless (gdb-display-source-buffer buffer)
+				    (gdb-display-buffer buffer nil))))
+			  (display-buffer buffer))))
 	 (pos))
     (if buffer
 	(progn