 ;; 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)
+(make-variable-buffer-local 'merlin-erroneous-buffer)
 
 (defvar merlin-highlight-overlay nil
   "Merlin overlay used for highlights.")

				     end
				     &optional length)
  "Remove an error from the pending error lists if it is edited by the user."
  (when is-after (merlin--clear-error-overlay overlay)))

(defun merlin-transform-display-errors (errors)
  "Populate the error list with ERRORS, transformed into an

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

(defun merlin--overlay (overlay)
  "Returns non-nil if OVERLAY is managed by merlin."
  (if overlay (overlay-get overlay 'merlin-kind) nil))

(defun merlin--overlay-pending-error (overlay)
  "Returns non-nil if OVERLAY is about a pending error."
  (if overlay (overlay-get overlay 'merlin-pending-error) nil))

(defun merlin--kill-error-if-edited (overlay
				     is-after
