From 2884ae6dc64517d00ed2f0156c18e8d306af81b3 Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Sun, 5 Jun 2005 07:55:32 +0000 Subject: [PATCH] (gdb-info-locals-handler): Use window point to preserve point. (gdb-find-file-hook): Add doc string. --- lisp/progmodes/gdb-ui.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index a9274cfcae..7e2022cc11 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el @@ -2058,12 +2058,12 @@ corresponding to the mode line clicked." (replace-match " (array);\n" nil nil)))) (let ((buf (gdb-get-buffer 'gdb-locals-buffer))) (and buf (with-current-buffer buf - (let ((p (point)) + (let ((p (window-point (get-buffer-window buf 0))) (buffer-read-only nil)) - (delete-region (point-min) (point-max)) + (erase-buffer) (insert-buffer-substring (gdb-get-create-buffer 'gdb-partial-output-buffer)) - (goto-char p))))) + (set-window-point (get-buffer-window buf 0) p))))) (run-hooks 'gdb-info-locals-hook)) (defun gdb-info-locals-custom () @@ -2341,6 +2341,8 @@ Add directory to search path for source files using the GDB command, dir.")) (add-hook 'find-file-hook 'gdb-find-file-hook) (defun gdb-find-file-hook () +"Set up buffer for debugging if file is part of the source code +of the current session." (if (and (not gdb-find-file-unhook) ;; in case gud or gdb-ui is just loaded gud-comint-buffer -- 2.20.1