diff --git a/elisp/ghc-check.el b/elisp/ghc-check.el index e881d89..0c4a71c 100644 --- a/elisp/ghc-check.el +++ b/elisp/ghc-check.el @@ -266,6 +266,14 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defun ghc-jump-file () + (interactive) + (let* ((ovl (car (ghc-check-overlay-at 1))) + (file (if ovl (overlay-get ovl 'ghc-file)))) + (if file (find-file file)))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + (defvar ghc-hlint-options nil "*Hlint options") (defvar ghc-check-command nil) diff --git a/elisp/ghc.el b/elisp/ghc.el index a9bc64a..d5d497b 100644 --- a/elisp/ghc.el +++ b/elisp/ghc.el @@ -48,6 +48,7 @@ (defvar ghc-info-key "\C-c\C-i") (defvar ghc-check-key "\C-x\C-s") (defvar ghc-toggle-key "\C-c\C-c") +(defvar ghc-jump-key "\C-c\C-j") (defvar ghc-module-key "\C-c\C-m") (defvar ghc-expand-key "\C-c\C-e") (defvar ghc-kill-key "\C-c\C-k") @@ -80,6 +81,7 @@ (define-key haskell-mode-map ghc-sort-key 'ghc-sort-lines) (define-key haskell-mode-map ghc-check-key 'ghc-save-buffer) (define-key haskell-mode-map ghc-toggle-key 'ghc-toggle-check-command) + (define-key haskell-mode-map ghc-jump-key 'ghc-jump-file) (define-key haskell-mode-map ghc-module-key 'ghc-insert-module) (define-key haskell-mode-map ghc-kill-key 'ghc-kill-process) (define-key haskell-mode-map ghc-hoogle-key 'haskell-hoogle)