# HG changeset patch # User Nick Roberts # Date 1117958132 0 # Node ID bd3ecd5ebdff72e6336ca13d2a880d0aa3ec25f6 # Parent e0a00e4eda5279aba680b30b550c866d4b67647a (gdb-info-locals-handler): Use window point to preserve point. (gdb-find-file-hook): Add doc string. diff -r e0a00e4eda52 -r bd3ecd5ebdff lisp/progmodes/gdb-ui.el --- a/lisp/progmodes/gdb-ui.el Sun Jun 05 07:54:50 2005 +0000 +++ b/lisp/progmodes/gdb-ui.el Sun Jun 05 07:55:32 2005 +0000 @@ -2058,12 +2058,12 @@ (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-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