Skip to content

Instantly share code, notes, and snippets.

@syohex
Created November 16, 2012 07:09
Show Gist options
  • Save syohex/4085014 to your computer and use it in GitHub Desktop.
Save syohex/4085014 to your computer and use it in GitHub Desktop.
popup error message with flymake at current line
(defun flymake-display-err-menu-for-current-line ()
(interactive)
(let* ((line (flymake-current-line-no))
(line-err-info (flymake-find-err-info flymake-err-info line))
(error-infos (nth 0 line-err-info))
(eof-char (char-to-string 0)))
(when error-infos
(loop for error-info in error-infos
for message = (flymake-ler-text error-info)
for file = (flymake-ler-file error-info)
for line = (flymake-ler-line error-info)
for filemsg = (or (and file " - %s(%d)" file line) "")
;; @@ remove EOF char, haskell error message contain EOF
for removed-eof = (replace-regexp-in-string eof-char "\n" message)
collect (format "%s%s" removed-eof filemsg) into messages
finally
(popup-tip (mapconcat 'identity
(delete-duplicates messages :test #'string=)
"\n"))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment