changeset 55330:df2107598877

(gdb-goto-breakpoint): Make buffer display file at breakpoint.
author Nick Roberts <nickrob@snap.net.nz>
date Mon, 03 May 2004 00:34:50 +0000
parents 1cd8cf52347b
children 0b7159e6ae8f
files lisp/progmodes/gdb-ui.el
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/gdb-ui.el	Mon May 03 00:33:21 2004 +0000
+++ b/lisp/progmodes/gdb-ui.el	Mon May 03 00:34:50 2004 +0000
@@ -1216,11 +1216,13 @@
       (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."