reverting file path and C-cC-j.

This commit is contained in:
Kazu Yamamoto 2012-03-02 21:36:58 +09:00
parent 18b6eec6ad
commit 1b2437a60e
3 changed files with 22 additions and 3 deletions

View File

@ -14,7 +14,6 @@ import GHC
import qualified Gap import qualified Gap
import HscTypes import HscTypes
import Outputable import Outputable
import System.FilePath
---------------------------------------------------------------- ----------------------------------------------------------------
@ -54,7 +53,7 @@ ppMsg :: SrcSpan -> Message -> PprStyle -> String
ppMsg spn msg stl = fromMaybe def $ do ppMsg spn msg stl = fromMaybe def $ do
(line,col,_,_) <- Gap.getSrcSpan spn (line,col,_,_) <- Gap.getSrcSpan spn
file <- Gap.getSrcFile spn file <- Gap.getSrcFile spn
return $ takeFileName file ++ ":" ++ show line ++ ":" ++ show col ++ ":" ++ cts ++ "\0" return $ file ++ ":" ++ show line ++ ":" ++ show col ++ ":" ++ cts ++ "\0"
where where
def = "ghc-mod:0:0:Probably mutual module import occurred\0" def = "ghc-mod:0:0:Probably mutual module import occurred\0"
cts = showMsg msg stl cts = showMsg msg stl

View File

@ -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) (defun ghc-extract-type (str)
(with-temp-buffer (with-temp-buffer
(insert str) (insert str)
@ -166,6 +178,9 @@
(defun ghc-flymake-err-get-title (x) (nth 0 x)) (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-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) (defalias 'ghc-flymake-have-errs-p 'ghc-flymake-data)
(defun ghc-flymake-data () (defun ghc-flymake-data ()
@ -177,6 +192,9 @@
(ghc-flymake-err-get-title (ghc-flymake-data))) (ghc-flymake-err-get-title (ghc-flymake-data)))
(defun ghc-flymake-err-list () (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) (provide 'ghc-flymake)

View File

@ -54,6 +54,7 @@
(defvar ghc-toggle-key "\C-c\C-c") (defvar ghc-toggle-key "\C-c\C-c")
(defvar ghc-module-key "\C-c\C-m") (defvar ghc-module-key "\C-c\C-m")
(defvar ghc-expand-key "\C-c\C-e") (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-hoogle-key (format "\C-c%c" (ghc-find-C-h)))
(defvar ghc-shallower-key "\C-c<") (defvar ghc-shallower-key "\C-c<")
(defvar ghc-deeper-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-type-key 'ghc-show-type)
(define-key haskell-mode-map ghc-info-key 'ghc-show-info) (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-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-import-key 'ghc-import-module)
(define-key haskell-mode-map ghc-previous-key 'flymake-goto-prev-error) (define-key haskell-mode-map ghc-previous-key 'flymake-goto-prev-error)
(define-key haskell-mode-map ghc-next-key 'flymake-goto-next-error) (define-key haskell-mode-map ghc-next-key 'flymake-goto-next-error)