 (make-variable-buffer-local 'merlin-lock-zone-fringe-overlay)
 
 ;; Errors related variables
+(defvar merlin-erroneous-buffer nil
+  "Whether the buffer is erroneous or not")
+(make-variable-buffer-local 'merlin-pending-errors)
+
 (defvar merlin-pending-errors nil
   "Pending errors.")
 (make-variable-buffer-local 'merlin-pending-errors)

  (merlin-error-reset)
  (merlin-sync-to-point (point-max) t)
  (let* ((errors (merlin-send-command 'errors))
         (errors (delete-if (lambda (e) (not (assoc 'start e))) errors))
         (errors (if merlin-report-warnings errors
                   (delete-if (lambda (e) (merlin-error-warning-p (cdr (assoc 'message e))))
                              errors))))
    (if (not errors) (when view-errors-p (message "ok"))
      (progn
        (merlin-transform-display-errors errors)
        (when view-errors-p
          (message "(%d pending errors, use %s to jump)"
                   (length errors)
                   (substitute-command-keys "\\[merlin-error-next]")))))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; COMPLETION-AT-POINT SUPPORT ;;

  "Clear error list."
  (interactive)
  (setq merlin-pending-errors nil)
  (setq merlin-erroneous-buffer nil)
  (merlin-error-delete-overlays))

(defun merlin--overlay-p (overlay)
