ghc-mod/elisp/ghc.el

73 lines
2.1 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)))
2010-03-11 13:47:05 +00:00
;; Or
;; (add-hook 'haskell-mode-hook (lambda () (ghc-init) (flymake-mode)))
2010-01-06 05:38:06 +00:00
;;; Code:
2010-07-16 10:48:42 +00:00
(defconst ghc-version "0.4.4")
2010-03-11 10:03:17 +00:00
;; (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)
(require 'ghc-command)
2010-04-23 09:37:48 +00:00
(require 'dabbrev)
2010-01-06 05:38:06 +00:00
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Customize Variables
;;;
2010-03-14 13:39:45 +00:00
(defvar ghc-completion-key "\e\t")
(defvar ghc-document-key "\e\C-d")
(defvar ghc-import-key "\e\C-m")
(defvar ghc-previous-key "\ep")
(defvar ghc-next-key "\en")
(defvar ghc-help-key "\e?")
(defvar ghc-insert-key "\et")
(defvar ghc-sort-key "\es")
(defvar ghc-check-key "\C-x\C-s")
2010-05-06 06:29:55 +00:00
(defvar ghc-toggle-key "\C-c\C-c")
2010-01-06 05:38:06 +00:00
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Initializer
;;;
(defvar ghc-initialized nil)
(defun ghc-init ()
2010-04-23 09:21:22 +00:00
(ghc-abbrev-init)
2010-01-06 05:38:06 +00:00
(unless ghc-initialized
2010-03-14 13:39:45 +00:00
(define-key haskell-mode-map ghc-completion-key 'ghc-complete)
(define-key haskell-mode-map ghc-document-key 'ghc-browse-document)
2010-05-04 08:52:16 +00:00
(define-key haskell-mode-map ghc-import-key 'ghc-import-module)
2010-03-14 13:39:45 +00:00
(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 'ghc-flymake-display-errors)
(define-key haskell-mode-map ghc-insert-key 'ghc-insert-template)
(define-key haskell-mode-map ghc-sort-key 'ghc-sort-lines)
(define-key haskell-mode-map ghc-check-key 'ghc-save-buffer)
2010-05-06 06:29:55 +00:00
(define-key haskell-mode-map ghc-toggle-key 'ghc-flymake-toggle-command)
2010-01-06 05:38:06 +00:00
(ghc-comp-init)
(setq ghc-initialized t)))
2010-03-11 10:03:17 +00:00
2010-04-23 09:21:22 +00:00
(defun ghc-abbrev-init ()
(make-local-variable 'dabbrev-case-fold-search)
(setq dabbrev-case-fold-search nil))
2010-03-11 10:03:17 +00:00
(provide 'ghc)