 (defun merlin-rewind ()
   "Rewind the knowledge of merlin of the current buffer to zero."
   (interactive)
-  (merlin-send-command (list 'reset 'name buffer-file-name))
-  (merlin-error-reset)
-  (setq merlin-lock-point (point-min)))
+  (let ((ext (file-name-extension buffer-file-name)))
+    (merlin-send-command (list 'reset (if (string-equal ext "mli") 'mli 'ml) buffer-file-name))
+    (merlin-error-reset)
+    (setq merlin-lock-point (point-min))))
 
 (defun merlin-refresh ()
   "Refresh changed merlin cmis."

(defun merlin-wait-for-answer ()
  "Waits for merlin to answer."
  (while (not merlin-ready)
    (accept-process-output merlin-process 0.1 nil t))
  merlin-result)

(defun merlin-send-command-async (command callback-if-success &optional callback-if-exn)

  "Makes sure the buffer is synchronized on merlin-side and centered around (point)."
  (unless point (setq point (point)))
  (merlin-tell-to-point point)
;  (merlin-seek-exact point)
  (merlin-sync-lock-zone-display))

;;;;;;;;;;;;;;;;;;
