Skip to content

Add chapter about spell checking #1192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added doc/anim/flyspell-prog-mode.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions doc/haskell-mode.texi
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ interpreter (e.g. GHCi).
* Interactive Haskell:: How to interact with GHCi (2)
* Editing Cabal files:: Cabal support
* Changing REPL target:: Start REPL with selected target (i.e. test,bench,etc.)
* Using with flyspell-prog-mode:: Spell check comments and strings
* Concept index:: Index of Haskell Mode concepts
* Function index:: index of commands
* Variable index:: Index of options and types
Expand Down Expand Up @@ -846,6 +847,41 @@ Answer ``yes'' to restart the session and run your tests, benchmarks, executable

TODO/WRITEME

@node Using with flyspell-prog-mode
@chapter Using with @code{flyspell-prog-mode}

Strings and comments can be checked for spelling mistakes. There is a
standard Emacs mode for this purpose, @code{flyspell-prog-mode}, that
can be enabled in Haskell buffers. Spelling errors are underlined using
squiggly red lines.

@ifhtml
@image{anim/flyspell-prog-mode}
@end ifhtml

Documentation for @code{flyspell-prog-mode} can be found in
@xref{Spelling,,,emacs}. Here we point to a couple of useful
keybindings:

@itemize
@item
@kbd{M-$} - Check and correct spelling of the word at point (@code{ispell-word}).

@item
@kbd{digit} - Replace the word, just this time, with one of the
displayed near-misses. Each near-miss is listed with a digit; type that
digit to select it.

@item
@kbd{SPC} - Skip this word—continue to consider it incorrect, but don’t
change it here.
@end itemize

To enable spell checking of strings and comments add this line to your
@code{~/.emacs} file:

@code{(add-hook 'haskell-mode-hook 'flyspell-prog-mode)}

@node Concept index
@unnumbered Concept index

Expand Down