]> git.eshelyaron.com Git - emacs.git/commitdiff
(def-gdb-auto-update-handler)
authorNick Roberts <nickrob@snap.net.nz>
Thu, 2 Jul 2009 06:36:43 +0000 (06:36 +0000)
committerNick Roberts <nickrob@snap.net.nz>
Thu, 2 Jul 2009 06:36:43 +0000 (06:36 +0000)
(gdb-data-list-register-values-handler)
(gdb-stack-list-locals-handler): Preserve point when switching buffers
using tabs.
(gdb-propertize-header): Inline temporary global variable.

lisp/progmodes/gdb-ui.el

index a8c25ff581aaad07b80bcc555c3db53cc1e32e8a..b34743b053975d5e686c55ba5c8d340b68d1f25e 100644 (file)
@@ -1813,13 +1813,16 @@ happens to be appropriate."
            (with-current-buffer buf
              (let* ((window (get-buffer-window buf 0))
                     (start (window-start window))
-                    (p (window-point window))
+                    (p (if window (window-point window) (point)))
                    (buffer-read-only nil))
                (erase-buffer)
                (insert-buffer-substring (gdb-get-buffer-create
                                          'gdb-partial-output-buffer))
-               (set-window-start window start)
-               (set-window-point window p)))))
+               (if window
+                   (progn
+                     (set-window-start window start)
+                     (set-window-point window p))
+                 (goto-char p))))))
      ;; put customisation here
      (,custom-defun)))
 
@@ -2170,9 +2173,8 @@ corresponding to the mode line clicked."
                    (set-window-dedicated-p (selected-window) nil)
                    (switch-to-buffer
                     (gdb-get-buffer-create ',buffer))
-                    (setq gdb-header (gdb-set-header ',buffer))
-                    (setq header-line-format gdb-header))
-                 (set-window-dedicated-p (selected-window) t)))))
+                   (setq header-line-format(gdb-set-header ',buffer))
+                   (set-window-dedicated-p (selected-window) t))))))
 
 (defun gdb-set-header (buffer)
   (cond ((eq buffer 'gdb-locals-buffer)
@@ -3823,12 +3825,15 @@ in_scope=\"\\(.*?\\)\".*?}")
        (with-current-buffer buf
          (let* ((window (get-buffer-window buf 0))
                 (start (window-start window))
-                (p (window-point window))
+                (p (if window (window-point window) (point)))
                 (buffer-read-only nil))
            (erase-buffer)
            (insert register-values)
-           (set-window-start window start)
-           (set-window-point window p))))))
+           (if window
+               (progn
+                 (set-window-start window start)
+                 (set-window-point window p))
+             (goto-char p)))))))
   (gdb-data-list-register-values-custom))
 
 (defun gdb-data-list-register-values-custom ()
@@ -3944,7 +3949,7 @@ in_scope=\"\\(.*?\\)\".*?}")
        (and buf (with-current-buffer buf
                   (let* ((window (get-buffer-window buf 0))
                          (start (window-start window))
-                         (p (window-point window))
+                         (p (if window (window-point window) (point)))
                          (buffer-read-only nil) (name) (value))
                     (erase-buffer)
                     (dolist (local locals-list)
@@ -3965,8 +3970,11 @@ in_scope=\"\\(.*?\\)\".*?}")
                       (insert
                        (concat name "\t" (nth 1 local)
                                "\t" value "\n")))
-                    (set-window-start window start)
-                    (set-window-point window p))))))))
+                    (if window
+                        (progn
+                          (set-window-start window start)
+                          (set-window-point window p))
+                      (goto-char p)))))))))
 
 (defun gdb-get-register-names ()
   "Create a list of register names."