                                            merlin-margin-error-string
                                            compilation-error-face))
               overlay)))
-         (errors   (mapcar err-point errors))
-         (overlays (mapcar err-overlay errors)))
+         (errors   (mapcar err-point errors)))
     (setq merlin-pending-errors errors)
-    (setq merlin-pending-errors-overlays overlays)))
+    (when merlin-error-in-margin (setq merlin-pending-errors-overlays
+                                       (mapcar err-overlay errors)))))
 
 (defun merlin-error-check (view-errors-p)
   "Check for 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-error-display-in-margin errors)
        (when (and view-errors-p errors)
          (message "(%d pending errors, use %s to jump)"
                   (length errors)
                   (substitute-command-keys "\\[merlin-error-next]")))))))

(defcustom merlin-margin-warning-string "?"
  "String to put in the margin of a line containing a warning."
  :group 'merlin :type 'string)

(defcustom merlin-error-after-save t
  "If non-nil, check for errors after saving"
  :group 'merlin :type 'boolean)

(defcustom merlin-error-in-margin t
  "If non-nil, display errors in margin"
  :group 'merlin :type 'boolean)

(defcustom merlin-display-lock-zone nil
  "How to display the locked zone.
