                    (substitute-command-keys "\\[merlin-error-next]"))
         (message "No errors")))))
 
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; COMPLETION-AT-POINT SUPPORT ;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ACTION WHEN IDLING ACTION ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defun merlin--idle-action ()
+  (merlin-show-error-on-current-line))
+
+(defvar merlin--idle-timer nil)
+
+;; Timer is started when merlin-mode is enabled for the first time.
+(defun merlin--idle-timer ()
+  (unless merlin--idle-timer
+    (setq merlin--idle-timer
+          (run-with-idle-timer 0.1 t 'merlin--idle-action))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;
+;; COMPLETION HELPERS ;;
+;;;;;;;;;;;;;;;;;;;;;;;;
 
 (defun merlin--completion-format-entry (entry)
   "Format the completion entry ENTRY."

    (when (merlin-process-dead-p instance)
      (merlin-start-process merlin-default-flags conf))
    (add-to-list 'after-change-functions 'merlin--sync-edit)
    (add-hook 'after-save-hook 'merlin--after-save nil 'local)))

(defun merlin-can-handle-buffer ()
  "Simple sanity check (used to avoid running merlin on, e.g., completion buffer)."

(defvar-local merlin--project-cache nil "Cache for merlin--project-get")
(defvar-local merlin--project-failures nil
  "When loading .merlin, list of errors reported. Only update error messages if
error list changes")

;;;;;;;;;;;
;; UTILS ;;
