pretty print for extra info.

This commit is contained in:
Kazu Yamamoto
2010-06-14 14:42:17 +09:00
parent d5763f70dc
commit 91859329ae
2 changed files with 10 additions and 6 deletions

View File

@@ -69,11 +69,14 @@
(defun ghc-flymake-insert-errors (title errs)
(save-excursion
(insert title "\n")
(insert title "\n\n")
(mapc (lambda (x) (insert (ghc-replace-character x ghc-null ghc-newline) "\n")) errs)
(goto-char (point-min))
(while (re-search-forward "In the [^:\n]+: " nil t)
(replace-match (concat "\n" (match-string 0) "\n ")))))
(while (re-search-forward "In the [^:\n]+: \\|Expected type: \\|Inferred type: " nil t)
(replace-match (concat "\n" (match-string 0) "\n ")))
(goto-char (point-max))
(while (re-search-backward "In the [a-z]+ argument" nil t)
(insert "\n"))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;