 
 
 (defun update-ros-topic-buffer-helper ()
+  (setq ros-topic-buffer (get-buffer-create "*ros-topics*"))
   (set-buffer ros-topic-buffer)
   (let ((old-stamp (rosemacs/get-stamp-string)))
     (erase-buffer)

      (match-string 1))))

(defvar ros-run-keymap (make-sparse-keymap))
(define-key ros-run-keymap "k" 'rosemacs/interrupt-process)
(define-key ros-run-keymap "q" 'rosemacs/kill-process-buffer)
(define-key ros-run-keymap "r" 'rosrun/restart-current)


  (interactive)
  (interrupt-process))

(defun rosemacs/terminate-process ()
  (interactive)
  (signal-process (get-buffer-process (current-buffer)) 'SIGTERM)
  )

(defun rosemacs/kill-process-buffer ()
  (interactive)
  (let ((process (get-buffer-process (current-buffer))))
    (if process
        (progn
          (when (eq (process-status process) 'run)
            (interrupt-process))
      ;; Give it time to shutdown cleanly
          (set-process-sentinel process '(lambda (proc event)
                                           (let ((buf (process-buffer proc)))
                                             (message "Killing %s in response to process event %s" buf event)
                                             (kill-buffer buf)))))
      (kill-buffer (current-buffer)))))

(defvar ros-topic-echo-keymap (make-sparse-keymap))
(define-key ros-topic-echo-keymap "k" 'rosemacs/terminate-process)
(define-key ros-topic-echo-keymap "q" 'rosemacs/kill-process-buffer)

(define-minor-mode ros-topic-echo-mode 
