 (defvar merlin-pending-errors nil
   "Pending errors.")
 (defvar merlin-lock-point 0
-  "Position up to which merlin knows about.")
+  "Position of merlin cursor.")
+(defvar merlin-dirty-point nil
+  "Last position where contents of local buffer and merlin buffer agree.")
 (defvar merlin-pending-errors-overlays nil
   "Overlays for the pending errors.")
 (defvar merlin-highlight-overlay nil "Merlin overlay used for highlights.")

  (if (and merlin-mode (< start merlin-lock-point))
      (progn
        (setq merlin-lock-point (merlin-retract-to start))
        (merlin-update-lock-zone-display))))

;; COMPLETION
(defun merlin-extract-complete (prefix l)

        (merlin-send-command "tell" '("end" nil)))
    (merlin-check-for-errors view-errors-p)
    (setq merlin-lock-point (merlin-get-position))
    (setq merlin-dirty-point nil)
    (merlin-update-lock-zone-display)))

      
