                    (let ((overlay (make-overlay
                                    (merlin-make-point (cdr (assoc 'start err)))
                                    (merlin-make-point (cdr (assoc 'end err))))))
-                     (overlay-put overlay 'face 'next-error)
+                     (if (string-match (cdr (assoc 'message err)) "^Warning")
+                         (merlin-put-margin-overlay overlay "!" compilation-error-face)
+                       (merlin-put-margin-overlay overlay "?" compilation-warning-face))
                      overlay)) errors))
   (message "(pending error, use C-c C-x to jump)"))
 

     'bounds-of-ocaml-atom-at-point)

; overlay management
(defun merlin-create-overlay (var bounds face timer)
  "Creates an overlay in the current buffer starting at `start', ending at `end',
using `face' and storing it in `var'. If `timer' is non-nil, the overlay is to disappear after `timer' seconds

    (goto-char merlin-lock-point)
    (setq merlin-lock-zone-margin-overlay (make-overlay (point) (point)))
    (set-window-margins nil 1)
    (merlin-put-margin-overlay merlin-lock-zone-margin-overlay
                               merlin-margin-lock)))

(defun merlin-update-highlight-lock-zone ()
  (if merlin-lock-zone-highlight-overlay
