如何实现文件中的错误提示?

前提是没有使用flycheck或者flymake,只是当你使用compile或者把代码运行在comint中时,文件中提示哪里出了错。如haskell-mode中所示(没有看源代码) 49

现在我在写一个inferior mode,想实现类似的效果,下面是部分代码

(defvar psci-compilation-regex-alist
  '(("^Error found:\n.+\nat \\(.+?\\) line \\([0-9]+\\), column \\([0-9]+\\) - line \\([0-9]+\\), column \\([0-9]+\\)"
     1 (2 . 4) (3 . 5)))
  "Psci `compilation-error-regexp-alist'.")

;;;###autoload
(define-derived-mode psci-mode comint-mode "psci REPL"
  (setq comint-prompt-regexp psci-prompt-regexp)
  (setq comint-prompt-read-only t)
  (setq-local paragraph-start psci-prompt-regexp)
  (setq-local compilation-error-regexp-alist psci-compilation-regex-alist)
  (compilation-shell-minor-mode t)
  :keymap psci-mode-map
  :group 'psci)

现在可以实现infeior mode中的错误部分,并且可以使用next-error跳转到文件中错误的地方,但是否可以像haskell-mode中有个下划线提示错误所在。

这样?

(overlay-put (make-overlay 1 (point-max))
 'face '(:underline (:style wave :color "Red1")))