blob: cb10440203cbe640eeb7e503e019de41df41fd0e (
plain)
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
|
[![MELPA](https://melpa.org/packages/haskell-tab-indent-badge.svg)](https://melpa.org/#/haskell-tab-indent) [![MELPA Stable](https://stable.melpa.org/packages/haskell-tab-indent-badge.svg)](https://stable.melpa.org/#/haskell-tab-indent)
This file provides `haskell-tab-indent-mode`, a simple Emacs
indentation minor mode for Haskell projects which require tabs for
indentation and do not permit spaces (except for where clauses, as a
special case). A prominent example of such a project is
[git-annex][].
The user may use TAB to cycle between possible indentations.
# Installation
You may copy `haskell-tab-indent.el` to somewhere in your `load-path`
and simply
(autoload 'haskell-tab-indent-mode "haskell-tab-indent.el")
Or you may use [git subtrees][]:
emacs-pkg-subtree add https://git.spwhitton.name/haskell-tab-indent 0.1.0
[git subtrees]: https://spwhitton.name/blog/entry/emacs-pkg-subtree/
haskell-tab-indent is also available from [MELPA][] (and MELPA Stable).
[MELPA]: http://melpa.org/
# Usage
If you set `indent-tabs-mode` in the `.dir-locals.el` file for a
project requiring tabs, you can use something like this in your init
file to enable this mode for such projects, defaulting to the usual
`haskell-indentation-mode`:
(add-hook 'haskell-mode-hook
(lambda ()
(add-hook 'hack-local-variables-hook
(lambda ()
(if indent-tabs-mode
(haskell-tab-indent-mode)
(haskell-indentation-mode)))
nil t))) ; local hook
[git-annex]: https://git-annex.branchable.com/coding_style/
|