ghc-mod/elisp/ghc.el

58 lines
1.6 KiB
EmacsLisp
Raw Normal View History

2010-01-06 05:38:06 +00:00
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; ghc.el
;;;
;; Author: Kazu Yamamoto <Kazu@Mew.org>
;; Created: Sep 25, 2009
2010-02-19 14:43:03 +00:00
;; Revised:
2010-01-06 05:38:06 +00:00
;; Put the following code to your "~/.emacs".
;;
;; (autoload 'ghc-init "ghc" nil t)
;; (add-hook 'haskell-mode-hook (lambda () (ghc-init)))
;;; Code:
2010-03-11 10:03:17 +00:00
(defvar ghc-version "0.2.0")
;; (eval-when-compile
;; (require 'haskell-mode))
2010-01-06 05:38:06 +00:00
(require 'ghc-comp)
(require 'ghc-doc)
2010-03-11 10:03:17 +00:00
(require 'ghc-flymake)
2010-01-06 05:38:06 +00:00
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Customize Variables
;;;
(defvar ghc-completion-key "\e\t")
(defvar ghc-document-key "\e\C-d")
(defvar ghc-import-key "\e\C-m")
2010-03-11 10:03:17 +00:00
(defvar ghc-check-key "\e\C-c")
(defvar ghc-previous-key "\e\C-p")
(defvar ghc-next-key "\e\C-n")
(defvar ghc-help-key "\e?")
2010-01-06 05:38:06 +00:00
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Initializer
;;;
(defvar ghc-initialized nil)
(defun ghc-init ()
(unless ghc-initialized
(define-key haskell-mode-map ghc-completion-key 'ghc-complete)
(define-key haskell-mode-map ghc-document-key 'ghc-browse-document)
(define-key haskell-mode-map ghc-import-key 'ghc-load-module-buffer)
2010-03-11 10:03:17 +00:00
(define-key haskell-mode-map ghc-check-key 'flymake-start-syntax-check)
(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-help-key 'flymake-display-err-menu-for-current-line)
2010-01-06 05:38:06 +00:00
(ghc-comp-init)
(setq ghc-initialized t)))
2010-03-11 10:03:17 +00:00
(provide 'ghc)