(gud-display-line): Find source buffer even when
authorNick Roberts <nickrob@snap.net.nz>
Mon, 1 Oct 2007 11:28:21 +0000 (11:28 +0000)
committerNick Roberts <nickrob@snap.net.nz>
Mon, 1 Oct 2007 11:28:21 +0000 (11:28 +0000)
GUD buffer has it's own frame.

lisp/progmodes/gud.el

index abe6192..4ec478d 100644 (file)
@@ -2630,7 +2630,7 @@ It is saved for when this flag is not set.")
           ;;  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 @@ Obeying it means displaying in another window the specified file and line."
         (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