 )
 (defun merlin-goto-file-and-point (data)
   "Goes to the file and position indicated by `DATA' which is an assoc list containing fields file, line and col"
-  (find-file-other-window (cdr (assoc 'file data)))
-  (merlin-goto-point data))
+  (if (> (length (cdr (assoc 'file data))) 0)
+      (find-file-other-window (cdr (assoc 'file data))))
+  (merlin-goto-point (cdr (assoc 'pos data))))
 
 (defun merlin-make-point (data)
   "Create a point from a couple line / col."

  (interactive)
  (let* ((ident (thing-at-point 'ocamlatom))
         (r (merlin-get-return-field (merlin-send-command "locate" (list ident)))))
    (if r
        (progn
          (push r merlin-position-stack)
          (merlin-goto-file-and-point r))
      (message "%s not found." ident))))

(defun merlin-pop-stack ()
  "Go back to the last position"
  (let ((r (pop merlin-position-stack)))
    (if r
        (merlin-goto-file-and-point r))))
    
;; Idle 
(defun merlin-idle-hook ()

  (let ((file
         (merlin-get-return-field
          (merlin-send-command "which" (list "path" (concat (downcase name) "." ext))))))
    (if file 
        (find-file-other-window file)
      (message "No such file"))))
(defun merlin-switch-to-ml (name)
  "Switch to a ML file."
