                           (format "Enter message name (default %s): " (current-word t t))
                         "Enter message name: ")
                       (current-word t t))))
-  (let ((p (ros-message-package message)))
-    (if p
-        (let ((dir (ros-package-dir p)))
-          (if dir
-              (find-file (concat dir "/msg/" message ".msg"))
-            (error "Could not find directory corresponding to package %s" p)))
-      (error "Could not find package for message %s" message))))
+  (let* ((p+m (split-string message "/"))
+         (p (if (cdr p+m)
+                (car p+m)
+              (ros-message-package message)))
+         (m (car (last p+m))))
+    (unless p
+      (error "Could not find package for message %s" message))
+    (let ((dir (ros-package-dir p)))
+      (unless dir
+        (error "Could not find directory corresponding to package %s" p))
+      (find-file (concat dir "/msg/" m ".msg")))))
 
 (defun find-ros-service (service)
   "Open definition of a ros service.  If used interactively, tab completion will work."

                          (format "Enter service name (default %s): " (current-word t t))
                        "Enter service name: ")
                      (current-word t t))))
  (let ((p (ros-service-package service)))
    (if p
        (let ((dir (ros-package-dir p)))
          (if dir
              (find-file (concat dir "/srv/" service ".srv"))
            (error "Could not find directory corresponding to package %s" p)))
      (error "Could not find package for service %s" service))))


;; (defun view-ros-message (message)

                                            nil))
                              ros-messages-list ros-message-packages)
                         nil nil nil nil (when (member default ros-messages-list)
                                           default)))
         (ws-pos (position ?\s result))
         (message (substring result 0 ws-pos))
         (package (when ws-pos
                    (let ((package-str (substring result ws-pos)))
                      (substring package-str 2 (- (length package-str) 1))))))
    (if package
        (concatenate 'string package "/" message)
      message)))

(defun ros-completing-read-service (prompt &optional default)
  (unless ros-services
    (cache-ros-service-locations))
  (let* ((ros-services-list (map 'list 'identity ros-services))
         (result (funcall ros-completion-function prompt
                         (map 'list (lambda (m pkg)
                                      (cons (if (> (count m ros-services-list :test 'equal) 1)
                                                (format "%s (%s)" m pkg)
                                              m)
                                            nil))
                              ros-services-list ros-service-packages)
                         nil nil nil nil (when (member default ros-services-list)
                                           default)))
         (ws-pos (position ?\s result))
         (service (substring result 0 ws-pos))
         (package (when ws-pos
                    (let ((package-str (substring result ws-pos)))
                      (substring package-str 2 (- (length package-str) 1))))))
    (if package
        (concatenate 'string package "/" service)
      service)))

(defun ros-completing-read-topic (prompt &optional default)
  (funcall ros-completion-function prompt (map 'list (lambda (m)
