M-t for hlint. An error/warning place is replaced with suggestion
but not perfect.
This commit is contained in:
parent
ca50279546
commit
badaea4eff
@ -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"))))
|
||||||
|
|
||||||
|
@ -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))))))))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user