From 294240c35d87784a87d85a97642ae518262ee37d Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Mon, 3 May 2004 00:34:50 +0000 Subject: [PATCH] (gdb-goto-breakpoint): Make buffer display file at breakpoint. --- lisp/progmodes/gdb-ui.el | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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." -- 2.39.5