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

  (set (make-local-variable 'merlin-ready) nil)
  (set (make-local-variable 'merlin-pending-errors) nil)
  (set (make-local-variable 'merlin-pending-errors-overlays) nil)
  (set (make-local-variable 'merlin-type-overlay) nil)
  (set (make-local-variable 'merlin-lock-zone-highlight-overlay) nil)
  (set (make-local-variable 'merlin-lock-zone-margin-overlay) nil)
  (set (make-local-variable 'merlin--project-file) nil)
  (set (make-local-variable 'merlin-enclosing-types) nil)
  (set (make-local-variable 'merlin-enclosing-offset) nil)
  (set (make-local-variable 'merlin-last-point-type) nil)
  (add-to-list 'after-change-functions 'merlin-edit)
  (merlin-load-project-file)
  (with-current-buffer (get-buffer-create merlin-type-buffer-name)


(defun merlin-edit (start end length)
  "Called when an edit is make to retract the locked zone if it is needed."
  (if (and merlin-mode (< start merlin-lock-point))
      (progn
        (setq merlin-lock-point (merlin-retract-to start))
        (merlin-update-lock-zone-display))))
