 	  (overlay-put ovl 'ghc-check t)
 	  (overlay-put ovl 'ghc-file file)
 	  (overlay-put ovl 'ghc-msg msg) ;; should be list
-	  (let ((face (if (string-match "^Warning" msg)
-			  'ghc-face-warn
-			'ghc-face-error)))
+	  (let ((face (if err 'ghc-face-error 'ghc-face-warn)))
 	    (overlay-put ovl 'face face)))))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(ghc-defstruct hilit-info file line col msg)

(defun ghc-check-send ()
  (concat "check " ghc-process-original-file "\n"))

	(ghc-check-highlight-original-buffer file buf infos)))
     (t
      (with-current-buffer ghc-process-original-buffer
	(remove-overlays (point-min) (point-max) 'ghc-check t))))
    (with-current-buffer ghc-process-original-buffer
      (let ((len (length infos)))
	(if (= len 0)
	    (setq mode-line-process "")
	  (let* ((errs (ghc-filter 'ghc-hilit-info-get-err infos))
		 (elen (length errs))
		 (wlen (- len elen)))
	    (setq mode-line-process (format " %d:%d" elen wlen))))))))

(defun ghc-check-highlight-original-buffer (ofile buf infos)
  (with-current-buffer buf
