     buf))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; roslaunch
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defun ros-launch (package-name)
+  "Open up the directory corresponding to PACKAGE-NAME in dired mode.  If used interactively, tab completion will work."
+  (interactive (list (ros-completing-read-pkg-file "Enter ros path: ")))
+  (multiple-value-bind (package dir-prefix dir-suffix) (parse-ros-file-prefix package-name)
+    (let* ((package-dir (ros-package-dir package))
+	   (path (if dir-prefix (concat package-dir dir-prefix dir-suffix) package-dir)))
+      (if path
+	  (let* ((name (format "roslaunch:%s/%s" package dir-suffix))
+                 (buf (generate-new-buffer name)))
+            (start-process name buf "roslaunch" path)
+            (save-excursion
+              (set-buffer buf)
+              (view-buffer-other-window buf)
+              (ros-launch-mode))
+            buf)
+	(error "Did not find %s in the ros package list." package-name)))))
+
+
+(defvar ros-launch-keymap (make-sparse-keymap))
+(define-key ros-launch-keymap "k" 'interrupt-ros-topic-echo)
+(define-key ros-topic-echo-keymap "q" 'kill-current-buffer)
+
+(define-minor-mode ros-launch-mode
+  "Mode used for roslaunch
+
+k kills the process (sends SIGINT)"
+  :init-value nil
+  :lighter " ros-launch"
+  :keymap ros-launch-keymap
+  )
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Keymap
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 

  :keymap ros-topic-echo-keymap
  (message "ros-run mode: k to stop, q to quit"))

(defun ros-run (pkg exec &rest args)
  "pkg is a ros package name and exec is the executable name.  Tab completes package name.  Exec defaults to package name itself."
  (interactive (list (setq ros-run-temp-var (ros-completing-read-package

              (throw 'done (file-name-nondirectory path))
            (setf path (directory-file-name (file-name-directory path)))))))))

(defun ros-package-for-buffer (buffer &optional allow-nonexistent)
  (let ((fn (buffer-file-name buffer)))
    (when fn
      (ros-package-for-path fn allow-nonexistent))))

(defun get-buffer-ros-package ()
  (or ros-buffer-package
