 (defun merlin-error-next ()
   "Jump to next error."
   (interactive)
+  (if (= merlin--dirty-point (point-max))
+      (when (merlin--process-idle)
+        (merlin--error-check-async))
+    (merlin--error-check nil))
   (let ((err (merlin--error-next-cycle)))
-    (unless err
-      (merlin--acquire-buffer)
-      ;; (prin1 "ERROR CHECK")
-      (merlin--error-check nil)
-      (setq err (merlin--error-next-cycle)))
     (unless (or err merlin-erroneous-buffer) (message "No errors"))
-    (when (and err (tq-queue-empty
-                     (buffer-local-value 'merlin-process-queue (merlin-process-buffer))))
-      (merlin--error-check-async))
     (when err
       (goto-char (car err))
       (message "%s" (cdr (assoc 'message (cdr err))))

(defun merlin--idle-timer ()
  (unless merlin--idle-timer
    (setq merlin--idle-timer
          (run-with-idle-timer 0.1 t 'merlin--idle-action))))

;;;;;;;;;;;;;;;;;;;;;;;;
;; COMPLETION HELPERS ;;

  (buffer-local-value 'merlin--process-owner (merlin-process-buffer instance-name)))

(defun merlin--process-busy (&optional instance-name)
  "Nil if no synchronous work is being done, sexp representation of
synchronous command being processed by merlin otherwise."
  (buffer-local-value 'merlin--process-busy (merlin-process-buffer instance-name)))

(put 'merlin-cancelled
     'error-conditions
     '(merlin-cancelled))

(defun merlin--process-idle ()
  "Non-nil iff nothing (synchronous nor asynchronous) is being done by merlin"
  (tq-queue-empty
    (buffer-local-value 'merlin-process-queue (merlin-process-buffer))))

(defun merlin--process-busy-set (value &optional instance-name)
  (with-current-buffer (merlin-process-buffer instance-name)
