M-t for hlint. An error/warning place is replaced with suggestion

but not perfect.
This commit is contained in:
Kazu Yamamoto 2010-06-14 14:26:14 +09:00
parent ca50279546
commit badaea4eff
2 changed files with 12 additions and 3 deletions

View File

@ -15,12 +15,12 @@
(cond (cond
((bobp) ((bobp)
(ghc-insert-module-template)) (ghc-insert-module-template))
((ghc-flymake-have-errs-p)
(ghc-flymake-insert-from-warning))
((save-excursion ((save-excursion
(beginning-of-line) (beginning-of-line)
(looking-at "^[^ ]+ *::")) (looking-at "^[^ ]+ *::"))
(ghc-insert-function-template)) (ghc-insert-function-template))
((ghc-flymake-have-errs-p)
(ghc-flymake-insert-from-warning))
(t (t
(message "Nothing to be done")))) (message "Nothing to be done"))))

View File

@ -89,7 +89,16 @@
(unless (re-search-forward "^$" nil t) (unless (re-search-forward "^$" nil t)
(goto-char (point-max)) (goto-char (point-max))
(insert "\n"))) (insert "\n")))
(insert "\n" (match-string 1 data) " = undefined\n")))))) (insert "\n" (match-string 1 data) " = undefined\n"))
((string-match "Found:\0[ ]*\\([^\0]+\\)\0Why not:\0[ ]*\\([^\0]+\\)" data)
(let ((old (match-string 1 data))
(new (match-string 2 data)))
(beginning-of-line)
(when (search-forward old nil t)
(let ((end (point)))
(search-backward old nil t)
(delete-region (point) end))
(insert new))))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;