From: Nick Roberts Date: Mon, 3 May 2004 00:34:50 +0000 (+0000) Subject: (gdb-goto-breakpoint): Make buffer display file at breakpoint. X-Git-Tag: ttn-vms-21-2-B4~6443 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=294240c35d87784a87d85a97642ae518262ee37d;p=emacs.git (gdb-goto-breakpoint): Make buffer display file at breakpoint. --- diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index 937d9189510..97e15fc2872 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el @@ -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."