]> git.eshelyaron.com Git - emacs.git/commitdiff
(gdb-goto-breakpoint): Make buffer display file at breakpoint.
authorNick Roberts <nickrob@snap.net.nz>
Mon, 3 May 2004 00:34:50 +0000 (00:34 +0000)
committerNick Roberts <nickrob@snap.net.nz>
Mon, 3 May 2004 00:34:50 +0000 (00:34 +0000)
lisp/progmodes/gdb-ui.el

index 937d918951092d24d11743536c57bf77fd0f275d..97e15fc2872ca8b1dfb4e42ca40a930b3363bf32 100644 (file)
@@ -1216,11 +1216,13 @@ current line."
       (let ((line (match-string 2))
            (file (match-string 1)))
        (save-selected-window
-         (gdb-display-buffer (find-file-noselect
-                              (if (file-exists-p file)
-                                  file
-                                (expand-file-name file gdb-cdir))))
-         (goto-line (string-to-number line))))))
+         (let* ((buf (find-file-noselect (if (file-exists-p file)
+                                             file
+                                           (expand-file-name file gdb-cdir))))
+                (window (gdb-display-buffer buf)))
+                (with-current-buffer buf
+                  (goto-line (string-to-number line))
+                  (set-window-point window (point))))))))
 
 (defun gdb-mouse-goto-breakpoint (event)
   "Display the file in the source buffer at the selected breakpoint."