 
 (defun merlin-tell-string (mode string)
   "Tell a string to merlin using `mode'"
-  (merlin-send-command "tell" (list "struct" string)))
+  (merlin-send-command "tell" (list mode string)))
 
 (defun merlin-flush-tell ()
   "Flush merlin teller"
   (merlin-send-command "tell" '("struct" nil)))
 
+(defun merlin-get-position ()
+  "Get the current position of merlin"
+  (merlin-make-point
+   (merlin-is-return
+    (merlin-send-command "seek" '("position")))))
+
+(defun merlin-seek (point)
+  "Seeks merlin's point to `point'"
+  (let ((data 
+	 (merlin-is-return (merlin-send-command "seek" (list "position" (merlin-unmake-point point))))))
+    (merlin-make-point data)))
+    
 (defun merlin-tell-piece (mode start end)
   (merlin-tell-string mode (buffer-substring start end)))
 

	 (setq temp (point))
	 (forward-line 10))
       (merlin-tell-piece mode temp end))))
(defun merlin-seek (point)
  "Seeks merlin's point to `point'"
  (let ((data 
	 (merlin-is-return (merlin-send-command "seek" (list "position" (merlin-unmake-point point))))))
    (merlin-make-point data)))
    
  



  (overlay-put merlin-overlay 'face 'merlin-locked-face))

(defun merlin-update-point (point view-errors-p)
  "Moves the merlin point to around the given the given point. It proceeds as follows:
- It retracts merlin from the point given in argument to get it to the last phrase ending.
- It tells merlin the contents between the last phrase known to merlin and the argument
- It continues until it finds the end of a phrase.

The parameter `view-errors-p' controls whether we should care for errors"
  (merlin-delete-error-overlays)
  (setq merlin-lock-point (merlin-retract-to point))
  (merlin-tell-piece-split "struct" merlin-lock-point point)
  (setq merlin-lock-point (merlin-tell-till-end-of-phrase))
  (if (not (merlin-view-errors view-errors-p))
      (let ((msg (current-message)))
        (setq merlin-lock-point (merlin-seek merlin-lock-point))
        (message msg)))
  (merlin-update-overlay)
)    
  
