reverting file path and C-cC-j.
This commit is contained in:
parent
18b6eec6ad
commit
1b2437a60e
@ -14,7 +14,6 @@ import GHC
|
||||
import qualified Gap
|
||||
import HscTypes
|
||||
import Outputable
|
||||
import System.FilePath
|
||||
|
||||
----------------------------------------------------------------
|
||||
|
||||
@ -54,7 +53,7 @@ ppMsg :: SrcSpan -> Message -> PprStyle -> String
|
||||
ppMsg spn msg stl = fromMaybe def $ do
|
||||
(line,col,_,_) <- Gap.getSrcSpan spn
|
||||
file <- Gap.getSrcFile spn
|
||||
return $ takeFileName file ++ ":" ++ show line ++ ":" ++ show col ++ ":" ++ cts ++ "\0"
|
||||
return $ file ++ ":" ++ show line ++ ":" ++ show col ++ ":" ++ cts ++ "\0"
|
||||
where
|
||||
def = "ghc-mod:0:0:Probably mutual module import occurred\0"
|
||||
cts = showMsg msg stl
|
||||
|
@ -77,6 +77,18 @@
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defun ghc-flymake-jump ()
|
||||
(interactive)
|
||||
(if (not (ghc-flymake-have-errs-p))
|
||||
(message "No errors or warnings")
|
||||
(let* ((acts (ghc-flymake-act-list))
|
||||
(act (car acts)))
|
||||
(if (not act)
|
||||
(message "No destination")
|
||||
(eval act)))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defun ghc-extract-type (str)
|
||||
(with-temp-buffer
|
||||
(insert str)
|
||||
@ -166,6 +178,9 @@
|
||||
(defun ghc-flymake-err-get-title (x) (nth 0 x))
|
||||
(defun ghc-flymake-err-get-errs (x) (nth 1 x))
|
||||
|
||||
(defun ghc-flymake-err-get-err-msg (x) (nth 0 x))
|
||||
(defun ghc-flymake-err-get-err-act (x) (nth 1 x))
|
||||
|
||||
(defalias 'ghc-flymake-have-errs-p 'ghc-flymake-data)
|
||||
|
||||
(defun ghc-flymake-data ()
|
||||
@ -177,6 +192,9 @@
|
||||
(ghc-flymake-err-get-title (ghc-flymake-data)))
|
||||
|
||||
(defun ghc-flymake-err-list ()
|
||||
(mapcar 'car (ghc-flymake-err-get-errs (ghc-flymake-data))))
|
||||
(mapcar 'ghc-flymake-err-get-err-msg (ghc-flymake-err-get-errs (ghc-flymake-data))))
|
||||
|
||||
(defun ghc-flymake-act-list ()
|
||||
(mapcar 'ghc-flymake-err-get-err-act (ghc-flymake-err-get-errs (ghc-flymake-data))))
|
||||
|
||||
(provide 'ghc-flymake)
|
||||
|
@ -54,6 +54,7 @@
|
||||
(defvar ghc-toggle-key "\C-c\C-c")
|
||||
(defvar ghc-module-key "\C-c\C-m")
|
||||
(defvar ghc-expand-key "\C-c\C-e")
|
||||
(defvar ghc-jump-key "\C-c\C-j")
|
||||
(defvar ghc-hoogle-key (format "\C-c%c" (ghc-find-C-h)))
|
||||
(defvar ghc-shallower-key "\C-c<")
|
||||
(defvar ghc-deeper-key "\C-c>")
|
||||
@ -75,6 +76,7 @@
|
||||
(define-key haskell-mode-map ghc-type-key 'ghc-show-type)
|
||||
(define-key haskell-mode-map ghc-info-key 'ghc-show-info)
|
||||
(define-key haskell-mode-map ghc-expand-key 'ghc-expand-th)
|
||||
(define-key haskell-mode-map ghc-jump-key 'ghc-flymake-jump)
|
||||
(define-key haskell-mode-map ghc-import-key 'ghc-import-module)
|
||||
(define-key haskell-mode-map ghc-previous-key 'flymake-goto-prev-error)
|
||||
(define-key haskell-mode-map ghc-next-key 'flymake-goto-next-error)
|
||||
|
Loading…
Reference in New Issue
Block a user