Initial emacs setup that somewhat worked for me

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
                             _____________

                              EMACS-SETUP

                                 Lemao
                             _____________


Table of Contents
_________________

1 Emacs installation
2 MELPA package repository
3 Flycheck installation
4 Auto-complete installation
5 Haskell support installation


1 Emacs installation
====================

  1. Install [Emacs 24 Starter-kit]
  ,----
  | git clone http://github.com/eschulte/emacs24-starter-kit.git .emacs.d
  `----
  1. Run 'emacs' to complete the installation


  [Emacs 24 Starter-kit] http://eschulte.github.io/emacs24-starter-kit/


2 MELPA package repository
==========================

  1. Edit ~/.emacs.d/${USER}.el
  ,----
  | ;; [==:INIT package manager==]
  | (require 'package)
  | (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t)
  | (package-initialize)
  `----

  1. Restart emacs and refresh package contents
  ,----
  | M-x package-refresh-contents RET
  `----

  NOTE: you should see refreshing package contents from
  melpa.milkbox.net


3 Flycheck installation
=======================

  1. Install flycheck
  ,----
  | M-x package-install RET flycheck RET
  `----

  1. Install flycheck color mode line
  ,----
  | M-x package-install RET flycheck-color-mode-line RET
  `----

  1. Configure flycheck
  Add the following to your ~/.emacs.d/${USER}.el:
  ,----
  | ;; [==:INIT flycheck==]
  | (add-hook 'after-init-hook 'global-flycheck-mode)
  | ;; (setq flycheck-check-syntax-automatically '(mode-enabled idle-change))
  | 
  | ;; (require 'flycheck-color-mode-line))
  | ;; (eval-after-load "flycheck"
  | ;;  '(add-hook 'flycheck-mode-hook 'flycheck-color-mode-line-mode))
  `----


4 Auto-complete installation
============================

  1. Install the auto-complete package
  ,----
  | M-x package-install RET auto-complete RET
  `----

  1. Configure auto-complete
  ,----
  | ;; [==:INIT flycheck==]
  | (require 'auto-complete)
  `----


5 Haskell support installation
==============================

  1. Install Haskell Platform

  2. Update cabal repository
  ,----
  | cabal update
  `----

  1. Install cabal packages
  ,----
  | cabal install hdevtools ghc-mod hlint stylish-haskell
  `----

  1. Install Haskell Emacs front-end(s)
  ,----
  | M-x package-install RET haskell-mode
  | M-x package-install RET ghc
  | M-x package-install RET ghci-completion
  `----

  1. Configure haskell-mode, ghc
  ,----
  | ;; [==:INIT haskell-mode==]
  | (add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)
  | 
  | ;; [==:INIT ghc-mod==]
  | (autoload 'ghc-init "ghc" nil t)
  | (add-hook 'haskell-mode-hook
  |       (lambda ()
  |         (ghc-init)))
  | 
  | ;; [==:INIT auto-complete==]
  | (ac-define-source ghc-mod
  |   '((depends ghc)
  |     (candidates . (ghc-select-completion-symbol))
  |     (symbol . "s")
  |     (cache)))
  | 
  | (defun my-ac-haskell-mode ()
  |   (setq ac-sources '(ac-source-words-in-same-mode-buffers
  |              ac-source-dictionary
  |              ac-source-ghc-mod)))
  | (add-hook 'haskell-mode-hook 'my-ac-haskell-mode)
  | 
  | 
  | ;; [==:INIT fnd-file-hook==]
  | (defun my-haskell-ac-init ()
  |   (when (member (file-name-extension buffer-file-name) '("hs" "lhs"))
  |     (auto-complete-mode t)
  |     (setq ac-sources '(ac-source-words-in-same-mode-buffers
  |                ac-source-dictionary
  |                ac-source-ghc-mod))))
  | (add-hook 'find-file-hook 'my-haskell-ac-init)
  `----