-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathshm-customizations.el
205 lines (152 loc) · 4.24 KB
/
shm-customizations.el
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
;;; shm-customizations.el --- Structured Haskell Mode
;; Copyright (c) 2014 Chris Done. All rights reserved.
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;; Code:
;; Group
(defgroup shm nil
"Structured editing mode for Haskell"
:group 'haskell)
;; Faces
(defface shm-quarantine-face
'((((class color)) :background "#443333"))
"Face for quarantines."
:group 'shm)
(defface shm-current-face
'((((class color)) :background "#373737"))
"Face for the current node."
:group 'shm)
;; Customizations
(defcustom shm-auto-insert-skeletons
t
"Auto-insert skeletons for case, if, etc."
:group 'shm
:type 'boolean)
(defcustom shm-auto-insert-bangs
t
"Auto-insert bangs when inserting :: in record fields."
:group 'shm
:type 'boolean)
(defcustom shm-skip-applications
t
"Skip successive applications to the top parent.
So if you have
foo| bar mu
And go up a parent, it will go to
foo bar mu|
instead of
foo bar| mu
I tend to want the former behaviour more often than the latter,
but others may differ."
:group 'shm
:type 'boolean)
(defcustom shm-program-name
"structured-haskell-mode"
"The path to call for parsing Haskell syntax."
:group 'shm
:type 'string)
(defcustom shm-indent-spaces
(if (boundp 'haskell-indent-spaces)
haskell-indent-spaces
2)
"The number of spaces to indent by default."
:group 'shm
:type 'string)
(defcustom shm-language-extensions
(if (boundp 'haskell-language-extensions)
haskell-language-extensions
'())
"Language extensions in use. Should be in format: -XFoo, -XNoFoo etc."
:group 'shm
:type '(repeat 'string))
(defcustom shm-lambda-indent-style
nil
"Specify a particular style for indenting lambdas?"
:group 'shm
:type '(choice (const leftmost-parent) (const nil)))
(defcustom shm-use-presentation-mode
nil
"Use haskell-presentation-mode?"
:group 'shm
:type 'boolean)
(defcustom shm-display-quarantine
t
"Display quarantine?"
:group 'shm
:type 'boolean)
(defcustom shm-use-hdevtools
nil
"Use hdevtools for type information?"
:group 'shm
:type 'boolean)
(defcustom shm-type-info-fallback-to-ghci
t
"Fallback to GHCi when the type-info backend returns nothing?"
:group 'shm
:type 'boolean)
(defcustom shm-colon-enabled
nil
"Do special insertion of colons."
:group 'shm
:type 'boolean)
(defcustom shm-prevent-parent-deletion
t
"Prevent backspacing over parent heads that would break the
syntax."
:group 'shm
:type 'boolean)
(defcustom shm-idle-timeout
0.2
"Number of seconds before re-parsing."
:group 'shm
:type 'string)
(defcustom shm-indent-point-after-adding-where-clause
nil
"Whether to indent point to the next line when inseting where clause, e.g.
| being a point:
foo x = ...
where
|
when option is t, as opposed to
foo x = ...
where |
when option is nil.
"
:group 'shm
:type 'boolean)
(defcustom shm-pragmas
'("LANGUAGE" "OPTIONS_GHC" "INCLUDE" "DEPRECATED" "WARNING"
"INLINE" "NOINLINE" "INLINABLE" "CONLIKE" "LINE" "RULES"
"SPECIALIZE" "UNPACK" "SOURCE" "SCC" "MINIMAL")
"Pragmas supported."
:group 'shm
:type 'list)
(defcustom shm-indent-if-offset 3
"Amount of indentation for 'true' and 'false' branches of the if expression.
E.g. if this is equal to `0' then 'if' snippet will be expanded as
if <condition>
then <true branch>
else <false branch>
If this is equal to `2' then 'if' snippet will be expanded as
if <condition>
then <true branch>
else <false branch>
If this is equal to `4' then 'if' snippet will be expanded as
if <condition>
then <true branch>
else <false branch>
etc."
:group 'shm
:type 'integer)
;; Provide
(provide 'shm-customizations)
;;; shm.el ends here
;; End: