@@ -117,12 +117,13 @@ gmane.comp.lang.haskell.emacs} newsgroup.
117
117
If you have discovered a bug or wish to request a new feature, you can
118
118
@uref {https://github.com/haskell/haskell-mode/issues/new , file a new
119
119
issue } with Haskell Mode's issue tracker. When filing a bug, please
120
- state your currently used software version (@kbd {M-x haskell-version },
121
- @kbd {M-x version }) and what steps to perform in order to reproduce the
122
- bug you're experiencing. Finally, if you happen to be proficient in
123
- @ref {Top ,Emacs Lisp ,,elisp } you are welcome to submit patches via
124
- @uref {https://help.github.com/articles/using-pull-requests , GitHub Pull
125
- Requests }.
120
+ state your currently used software version (@kbd {M-x }
121
+ @code {haskell-version }, @kbd {M-x } @code {version }) and what steps to
122
+ perform in order to reproduce the bug you're experiencing. Finally, if
123
+ you happen to be proficient in @ref {Top ,Emacs Lisp ,,elisp } you are
124
+ welcome to submit patches via
125
+ @uref {https://help.github.com/articles/using-pull-requests , GitHub
126
+ Pull Requests }.
126
127
127
128
@node Getting Started
128
129
@chapter Getting Started
@@ -146,29 +147,30 @@ Make sure you have this in your @uref{http://www.gnu.org/software/emacs/manual/h
146
147
147
148
Then run Emacs, and evaluate:
148
149
149
- @code {M-x package-refresh-contents }
150
+ @kbd {M-x } @code { package-refresh-contents }
150
151
151
152
and then follow by
152
153
153
- @code {M-x package-install RET haskell-mode }
154
+ @kbd {M-x } @code { package-install } @kbd { RET } @code { haskell-mode }
154
155
155
- Voila! @code {haskell-mode } is installed! You should be able to edit Haskell
156
- source code in color now.
156
+ Voila! @code {haskell-mode } is installed! You should be able to edit
157
+ Haskell source code in color now.
157
158
158
159
@section Installation - more information
159
160
160
161
@code {haskell-mode } supports GNU Emacs versions 24 and upcoming 25
161
162
(snapshot).
162
163
163
- @code {haskell-mode } is available from @uref {http://stable.melpa.org ,melpa-stable (releases) } and @uref {http://melpa.org , melpa
164
- (git snapshots) }.
164
+ @code {haskell-mode } is available from
165
+ @uref {http://stable.melpa.org ,melpa-stable (releases) } and
166
+ @uref {http://melpa.org , melpa (git snapshots) }.
165
167
166
168
Other means of obtaining @code {haskell-mode } include
167
169
@uref {https://github.com/dimitri/el-get , el-get },
168
170
@uref {https://github.com/bbatsov/prelude , Emacs Prelude } and @uref {https://packages.debian.org/search?keywords=haskell-mode , Debian package }.
169
171
170
- Last version of @code {haskell-mode } that supported Emacs 23 is @code { haskell-mode }
171
- 13.18 available at
172
+ Last version of @code {haskell-mode } that supported Emacs 23 is
173
+ @code { haskell-mode } 13.18 available at
172
174
@uref {https://github.com/haskell/haskell-mode/releases/tag/v13.18 }.
173
175
174
176
@section Customizing
@@ -200,17 +202,17 @@ customize-variable @key{RET} haskell-mode-hook}.
200
202
@dfn {Haskell Mode } is actually a collection of so-called major
201
203
modes@footnote {for more information about the concept of @dfn {major
202
204
modes } @pxref {Major Modes ,,,emacs }} one of which is called
203
- @code {haskell-mode }. To avoid confusion, when referring to this package
204
- the name ``Haskell mode'' is written in a normal font, whereas when
205
- referring the major mode of the same name @code {haskell-mode } written
206
- with a dash in-between in a typewriter font is used.
205
+ @code {haskell-mode }. To avoid confusion, when referring to this
206
+ package the name ``Haskell mode'' is written in a normal font, whereas
207
+ when referring the major mode of the same name @code {haskell-mode }
208
+ written with a dash in-between in a typewriter font is used.
207
209
208
210
As one might guess, @code {haskell-mode } is the (programming
209
- language@footnote {@code {haskell-mode } is derived from @code { prog-mode }})
210
- major mode for editing (non-literate) Haskell source
211
- code. @code {haskell-mode } is associated with the file extensions listed
212
- below by default@footnote {for more information about file associations ,
213
- @pxref {Choosing Modes ,,,emacs }}.
211
+ language@footnote {@code {haskell-mode } is derived from
212
+ @code { prog-mode }}) major mode for editing (non-literate) Haskell
213
+ source code. @code {haskell-mode } is associated with the file
214
+ extensions listed below by default@footnote {for more information about
215
+ file associations , @pxref {Choosing Modes ,,,emacs }}.
214
216
215
217
@table @file
216
218
@item .hs
@@ -267,7 +269,7 @@ There are a few functions for managing imports.
267
269
268
270
To jump to your import list, run
269
271
270
- @code {M-x haskell-navigate-imports }
272
+ @kbd {M-x } @code { haskell-navigate-imports }
271
273
272
274
It's nicer to have a keybinding to do this, for example:
273
275
@@ -282,30 +284,31 @@ cycle.
282
284
283
285
To generally format (sort, align) your imports, you can run
284
286
285
- @code {M-x haskell-mode-format-imports }
287
+ @kbd {M-x } @code { haskell-mode-format-imports }
286
288
287
289
Or @kbd {C-c C-. }.
288
290
289
291
@subsection Sort imports
290
292
291
293
To just sort imports, jump to an import section and run
292
294
293
- @code {M-x haskell-sort-imports }
295
+ @kbd {M-x } @code { haskell-sort-imports }
294
296
295
297
@subsection Align imports
296
298
297
299
To just align imports, jump to an import section and run
298
300
299
- @code {M-x haskell-align-imports }
301
+ @kbd {M-x } @code { haskell-align-imports }
300
302
301
303
@subsection stylish-haskell
302
304
303
305
As an alternative to the elisp functions described above, haskell-mode
304
- can use the program @url {
305
- http://hackage.haskell.org/package/stylish-haskell , stylish-haskell }
306
- to format imports. You can set this behavior by typing: @kbd {M-x }
307
- @code {customize-variable } @kbd {RET } @code {haskell-stylish-on-save }.
308
- You can install @code {stylish-haskell } by running @code {stack install
306
+ can use the program
307
+ @url {http://hackage.haskell.org/package/stylish-haskell ,
308
+ stylish-haskell } to format imports. You can set this behavior by
309
+ typing: @kbd {M-x } @code {customize-variable } @kbd {RET }
310
+ @code {haskell-stylish-on-save }. You can install
311
+ @code {stylish-haskell } by running @code {stack install
309
312
stylish-haskell }, or if you have not installed @code {stack },
310
313
@code {cabal install stylish-haskell }.
311
314
@@ -323,20 +326,22 @@ Haskell buffers only).
323
326
324
327
@section Completion support
325
328
326
- @code {haskell-mode } can complete symbols, pragma directives and
327
- language extensions out-of-box. @code {haskell-mode } completes
328
- identifiers using tags (see @xref { Tags } ), however you can get more
329
- precise completions with @code {haskell-interactive-mode }. In
330
- interactive mode completion candidates are produced by querying GHCi
331
- REPL.
329
+ @code {haskell-mode } can complete symbols, pragma directives, language
330
+ extensions, and language keywords out-of-box. @code {haskell-mode }
331
+ completes identifiers (symbols) using tags (see `` Tags'' ), however you
332
+ can get more precise completions with @code {haskell-interactive-mode }.
333
+ In interactive mode completion candidates are produced by querying
334
+ GHCi REPL.
332
335
333
336
@ifhtml
334
337
@image {anim/company-mode-language-pragma }
335
338
@end ifhtml
336
339
337
- If haskell-interactive-mode is enabled and working haskell mode
340
+ If @code { haskell-interactive-mode } is enabled and working Haskell mode
338
341
provides completions for import statements taking into account
339
- currently loaded and available packages.
342
+ currently loaded and available packages. Also it completes symbols
343
+ querying REPL with @code {:complete } command, hence completion
344
+ candidate list also includes symbols from imported modules.
340
345
341
346
@ifhtml
342
347
@image {anim/company-mode-import-statement }
@@ -352,7 +357,8 @@ completion candidates from completion-at-point function
352
357
@code {company-mode } provides special backend for dabbrev code
353
358
completions, namely @code {company-dabbrev-code }. To combine
354
359
completions from diffrent backends you can create grouped backends, it
355
- is very easy — a grouped backend is just a list of backends:
360
+ is very easy — a grouped backend is just a list of backends, for
361
+ example:
356
362
357
363
@lisp
358
364
(add-hook 'haskell-mode-hook
0 commit comments