aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Roberts2005-06-05 07:55:32 +0000
committerNick Roberts2005-06-05 07:55:32 +0000
commit2884ae6dc64517d00ed2f0156c18e8d306af81b3 (patch)
tree69e635bb0f452d277243e2f2d4ce8fd67342867a
parent32759db597d9c02f23e557a628ee76ad230c096f (diff)
downloademacs-2884ae6dc64517d00ed2f0156c18e8d306af81b3.tar.gz
emacs-2884ae6dc64517d00ed2f0156c18e8d306af81b3.zip
(gdb-info-locals-handler): Use window point to preserve point.
(gdb-find-file-hook): Add doc string.
-rw-r--r--lisp/progmodes/gdb-ui.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index a9274cfcae7..7e2022cc11c 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -2058,12 +2058,12 @@ corresponding to the mode line clicked."
2058 (replace-match " (array);\n" nil nil)))) 2058 (replace-match " (array);\n" nil nil))))
2059 (let ((buf (gdb-get-buffer 'gdb-locals-buffer))) 2059 (let ((buf (gdb-get-buffer 'gdb-locals-buffer)))
2060 (and buf (with-current-buffer buf 2060 (and buf (with-current-buffer buf
2061 (let ((p (point)) 2061 (let ((p (window-point (get-buffer-window buf 0)))
2062 (buffer-read-only nil)) 2062 (buffer-read-only nil))
2063 (delete-region (point-min) (point-max)) 2063 (erase-buffer)
2064 (insert-buffer-substring (gdb-get-create-buffer 2064 (insert-buffer-substring (gdb-get-create-buffer
2065 'gdb-partial-output-buffer)) 2065 'gdb-partial-output-buffer))
2066 (goto-char p))))) 2066 (set-window-point (get-buffer-window buf 0) p)))))
2067 (run-hooks 'gdb-info-locals-hook)) 2067 (run-hooks 'gdb-info-locals-hook))
2068 2068
2069(defun gdb-info-locals-custom () 2069(defun gdb-info-locals-custom ()
@@ -2341,6 +2341,8 @@ Add directory to search path for source files using the GDB command, dir."))
2341(add-hook 'find-file-hook 'gdb-find-file-hook) 2341(add-hook 'find-file-hook 'gdb-find-file-hook)
2342 2342
2343(defun gdb-find-file-hook () 2343(defun gdb-find-file-hook ()
2344"Set up buffer for debugging if file is part of the source code
2345of the current session."
2344 (if (and (not gdb-find-file-unhook) 2346 (if (and (not gdb-find-file-unhook)
2345 ;; in case gud or gdb-ui is just loaded 2347 ;; in case gud or gdb-ui is just loaded
2346 gud-comint-buffer 2348 gud-comint-buffer