Skip to content

Commit df1ae07

Browse files
committed
Merge pull request #1192 from gracjan/pr-spell-checking-chapter
Add chapter about spell checking
2 parents 37113ff + 903be02 commit df1ae07

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

doc/anim/flyspell-prog-mode.gif

266 KB
Loading

doc/haskell-mode.texi

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ interpreter (e.g. GHCi).
6161
* Interactive Haskell:: How to interact with GHCi (2)
6262
* Editing Cabal files:: Cabal support
6363
* Changing REPL target:: Start REPL with selected target (i.e. test,bench,etc.)
64+
* Using with flyspell-prog-mode:: Spell check comments and strings
6465
* Concept index:: Index of Haskell Mode concepts
6566
* Function index:: index of commands
6667
* Variable index:: Index of options and types
@@ -846,6 +847,41 @@ Answer ``yes'' to restart the session and run your tests, benchmarks, executable
846847

847848
TODO/WRITEME
848849

850+
@node Using with flyspell-prog-mode
851+
@chapter Using with @code{flyspell-prog-mode}
852+
853+
Strings and comments can be checked for spelling mistakes. There is a
854+
standard Emacs mode for this purpose, @code{flyspell-prog-mode}, that
855+
can be enabled in Haskell buffers. Spelling errors are underlined using
856+
squiggly red lines.
857+
858+
@ifhtml
859+
@image{anim/flyspell-prog-mode}
860+
@end ifhtml
861+
862+
Documentation for @code{flyspell-prog-mode} can be found in
863+
@xref{Spelling,,,emacs}. Here we point to a couple of useful
864+
keybindings:
865+
866+
@itemize
867+
@item
868+
@kbd{M-$} - Check and correct spelling of the word at point (@code{ispell-word}).
869+
870+
@item
871+
@kbd{digit} - Replace the word, just this time, with one of the
872+
displayed near-misses. Each near-miss is listed with a digit; type that
873+
digit to select it.
874+
875+
@item
876+
@kbd{SPC} - Skip this word—continue to consider it incorrect, but don’t
877+
change it here.
878+
@end itemize
879+
880+
To enable spell checking of strings and comments add this line to your
881+
@code{~/.emacs} file:
882+
883+
@code{(add-hook 'haskell-mode-hook 'flyspell-prog-mode)}
884+
849885
@node Concept index
850886
@unnumbered Concept index
851887

0 commit comments

Comments
 (0)