(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)))
(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)
(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 ()
(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)
(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."