                       (buffer-substring (match-beginning 1) (match-end 1)))
                      end
                      (string-to-int
-                      (buffer-substring (match-beginning 2) (match-end 2)))))))
-       (cond (beg
+                      (buffer-substring (match-beginning 2) (match-end 2)))))
+           (next-line)
+           (beginning-of-line)
+           (if (and (looking-at "Warning")
+                    caml-next-error-skip-warnings-flag)
+               (setq skip 't))))
+       (cond
+        (skip (next-error))
+        (beg
               (setq end (- end beg))
               (beginning-of-line)
               (forward-byte beg)

                                         beg end (current-buffer))
                           (sit-for 60))
                       (delete-overlay caml-error-overlay)))))))))

;; Usual match-string doesn't work properly with font-lock-mode
;; on some emacs.

;; Wrapper around next-error.

(defvar caml-error-overlay nil)
(defvar caml-next-error-skip-warnings-flag nil)

;;itz 04-21-96 somebody didn't get the documetation for next-error
;;right. When the optional argument is a number n, it should move
