     (setq errors (remove nil (mapcar 'merlin--overlay-pending-error errors)))
     (setq err (merlin--error-at-position point errors))
     (if err (cons point err) nil)))
+
+(defun merlin--after-save ()
+  (when (merlin-error-after-save) (merlin-error-check)))
 
 (defun merlin-error-prev ()
   "Jump back to previous error."

  "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."

;; ERROR REPORT ;;
;;;;;;;;;;;;;;;;;;

(defun merlin--chomp (str)
  "Remove whitespace at the beginning and end of STR."
  (replace-regexp-in-string "^[[:space:]\n]\+\\|[[:space:]\n]\+$" "" str))

