 (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 (not (merlin-is-last-user-p))
      (merlin-rewind))
  (save-excursion
    (setq merlin-lock-point (merlin-retract-to (point)))
    (merlin-tell-piece-split "struct" merlin-lock-point (point))
    (merlin-tell-till-end-of-phrase view-errors-p)))
  

  (interactive)
  (merlin-send-command "reset" (list "name" buffer-file-name))
  (setq merlin-lock-point (point-min))
  (setq merlin-dirty-point nil)
  (merlin-delete-error-overlays)
  (setq merlin-pending-errors nil)
  (merlin-update-lock-zone-display)
