Skip to content

Commit 381cc63

Browse files
committed
Add more content and cleanups to haskell-mode Info manual
1 parent 2b72ce3 commit 381cc63

File tree

1 file changed

+55
-34
lines changed

1 file changed

+55
-34
lines changed

haskell-mode.texi

+55-34
Original file line numberDiff line numberDiff line change
@@ -57,53 +57,50 @@ Haskell Mode is an Haskell development Environment for GNU Emacs. It provides s
5757
@node Introduction, Getting Started, Top, Top
5858
@chapter Introduction
5959

60-
Haskell Mode is a major mode for editing Haskell (http://www.haskell.org) programs.
60+
@dfn{Haskell Mode} is a major mode providing a convenient environment for editing @uref{http://www.haskell.org,Haskell} programs.
6161

62-
Some of its major features include:
62+
Some of its major features are:
6363

6464
@itemize
6565
@item
66-
syntax highlighting (font lock),
66+
Syntax highlighting (font lock),
6767
@item
6868
automatic indentation,
6969
@item
7070
on-the-fly documentation,
7171
@item
72-
interaction with inferior GHCi/Hugs instance,
72+
interaction with inferior GHCi/Hugs instance, and
7373
@item
74-
scans declarations and places them in a menu.
74+
scanning declarations and placing them in a menu.
7575
@end itemize
7676

7777
This Info manual is work in progress and incomplete. However, you can find more information at these locations:
7878

7979
@itemize
8080
@item
81-
Haskell Mode's GitHub Home: @uref{https://github.com/haskell/haskell-mode}
81+
@uref{https://github.com/haskell/haskell-mode,Haskell Mode's GitHub Home}
8282
@item
83-
The Haskell Wiki: @uref{http://www.haskell.org/haskellwiki/Haskell_mode_for_Emacs}
83+
@uref{http://www.haskell.org/haskellwiki/Haskell_mode_for_Emacs,Haskell Wiki Emacs Page}
8484
@end itemize
8585

8686
@node Getting Started, Editing Code, Introduction, Top
8787
@chapter Getting Started
8888

89-
One of the recommended ways is to install Haskell Mode via the Marmalade package archive (@uref{http://marmalade-repo.org/packages/haskell-mode}).
89+
If you are reading this, you have most likely already managed to install Haskell mode in one way or another. However, just for the record, the officially recommended way to install Haskell Mode via the @uref{http://marmalade-repo.org/packages/haskell-mode,Marmalade package archive} which contains the latest stable release of Haskell Mode.
9090

91-
Most of Haskell Mode's settings are exposed via Emacs' @pxref{Easy Customization,,, emacs} interface. You can use @kbd{M-x haskell-customize} to browse the @code{haskell} customization sub-tree.
91+
@findex haskell-customize
92+
Most of Haskell Mode's settings are configurable via customizable variables (@xref{Easy Customization,,, emacs}, for details). You can use @kbd{M-x haskell-customize} to browse the @code{haskell} customization sub-tree.
9293

93-
TODO:
94-
@itemize
95-
@item
96-
provide basic instructions to get up and running with haskell-mode
97-
@item
98-
tell about the most important commands
99-
@item
100-
tell where to find advanced help
101-
@end itemize
94+
One of the important setting you should customize is the @code{haskell-mode-hook} variable (@pxref{Hooks,,, emacs}) which gets run right after the @code{haskell-mode} major mode is initialized for a buffer. You can customize @code{haskell-mode-hook} by @kbd{M-x customize-variable @key{RET} haskell-mode-hook}. It's highly recommended you set up indentation to match to match your preferences, @xref{Indentation}.
95+
96+
@c TODO:
97+
@c provide basic instructions to get up and running with haskell-mode
98+
@c tell about the most important commands
10299

103100
@node Editing Code, Unicode, Getting Started, Top
104101
@chapter Editing Code
105102

106-
TODO
103+
TODO/WRITEME
107104

108105
@node Unicode, Indentation, Editing Code, Top
109106
@chapter Unicode support
@@ -130,20 +127,38 @@ If you don't like the highlighting of partially matching tokens you can turn it
130127
@node Indentation, inferior-haskell-mode, Unicode, Top
131128
@chapter Indentation
132129

133-
@findex turn-on-haskell-indent
134-
@findex turn-on-haskell-indentation
135-
@findex turn-on-haskell-simple-indent
136130
@cindex indentation
137131

138-
TODO:
139-
@itemize
140-
@item
141-
tell about the three available basic indentation modules
142-
@item
143-
tell about the import sorting/alignment modules
144-
@item
145-
tell about customizations
146-
@end itemize
132+
Three Haskell indentation schemes are included in Haskell mode:
133+
134+
@ftable @code
135+
136+
@item turn-on-haskell-simple-indent
137+
138+
A very simple indentation scheme; In this scheme, @key{TAB} will now move the cursor to the next indent point in the previous nonblank line. An indent point is a non-whitespace character following whitespace.
139+
140+
@item turn-on-haskell-indent
141+
142+
Intelligent semi-automatic indentation for Haskell's layout rule. The basic idea is to have @key{TAB} cycle through possibilities indentation points based on some clever heuristics.
143+
144+
The rationale and the implementation principles are described in more detail the article @cite{Dynamic tabbing for automatic indentation with the layout rule} published in the Journal of Functional Programming 8.5 (1998).
145+
146+
@item turn-on-haskell-indentation
147+
148+
Improved variation of @code{turn-on-haskell-indent} indentation mode. Rebinds @key{RET} and @key{DEL}, so that indentations can be set and deleted as if they were real tabs.
149+
150+
@end ftable
151+
152+
To enable one of these three mutually exclusive indentation schemes, you just need call one (and only one!) of the `turn-on-*' commands while in the buffer you want the indentation scheme to be activated for.
153+
154+
The recommended way is to add one of @code{turn-on-*} commands to @code{haskell-mode-hook}. This can be done either by using @kbd{M-x customize-variable @key{RET} haskell-mode-hook} which provides a convenient user interface or by adding @emph{one} the following three lines to your @file{.emacs} file:
155+
156+
@example
157+
(add-hook 'haskell-mode-hook 'turn-on-haskell-simple-indent)
158+
(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
159+
(add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)
160+
@end example
161+
147162

148163
@node inferior-haskell-mode, haskell-interactive-mode, Indentation, Top
149164
@chapter @code{inferior-haskell-mode}
@@ -166,7 +181,8 @@ The Haskell interpreter used by the inferior Haskell mode is autodetected by def
166181

167182
Currently, GHCi and Hugs are support as Haskell interpreter.
168183

169-
TODO: write about supported features
184+
TODO/WRITEME
185+
@c write about supported features
170186

171187
@node haskell-interactive-mode, haskell-cabal-mode, inferior-haskell-mode, Top
172188
@chapter @code{haskell-interactive-mode}
@@ -181,7 +197,7 @@ TODO/WRITEME
181197
@findex inferior-cabal-mode
182198
@vindex inferior-cabal-mode-hook
183199

184-
WRITEME
200+
TODO/WRITEME
185201

186202
@node Concept index, Function index, haskell-cabal-mode, Top
187203
@unnumbered Concept index
@@ -198,5 +214,10 @@ WRITEME
198214

199215
@printindex vr
200216

201-
202217
@bye
218+
219+
@c Local Variables:
220+
@c eval: (visual-line-mode t)
221+
@c eval: (linum-mode t)
222+
@c eval: (hl-line-mode t)
223+
@c End:

0 commit comments

Comments
 (0)