Function: flyspell-mode
flyspell-mode is an autoloaded, interactive and byte-compiled function
defined in flyspell.el.gz.
Signature
(flyspell-mode &optional ARG)
Documentation
Toggle on-the-fly spell checking (Flyspell mode).
Flyspell mode is a buffer-local minor mode. When enabled, it spawns a single Ispell process and checks each word. The default flyspell behavior is to highlight incorrect words.
This mode is geared toward text modes. In buffers that contain
code, flyspell-prog-mode is usually a better choice.
Bindings:
M-$ (ispell-word): correct words (using Ispell).
M-x flyspell-auto-correct-word (flyspell-auto-correct-word): automatically correct word.
M-x flyspell-auto-correct-previous-word (flyspell-auto-correct-previous-word): automatically correct the last misspelled word.
M-x flyspell-correct-word (flyspell-correct-word) (or down-mouse-2): popup correct words.
Hooks:
This runs flyspell-mode-hook after flyspell mode is entered or exit.
Remark:
flyspell-mode(var)/flyspell-mode(fun) uses ispell-mode. Thus all Ispell options are
valid. For instance, a different dictionary can be used by
invoking ispell-change-dictionary.
Consider using the ispell-parser to check your text. For instance
consider adding:
(add-hook 'tex-mode-hook (lambda () (setq ispell-parser 'tex)))
in your init file.
M-x flyspell-region (flyspell-region) checks all words inside a region.
M-x flyspell-buffer (flyspell-buffer) checks the whole buffer.
This is a minor mode. If called interactively, toggle the Flyspell
mode mode. If the prefix argument is positive, enable the mode, and if
it is zero or negative, disable the mode.
If called from Lisp, toggle the mode if ARG is toggle. Enable the
mode if ARG is nil, omitted, or is a positive number. Disable the mode
if ARG is a negative number.
To check whether the minor mode is enabled in the current buffer,
evaluate the variable flyspell-mode(var)/flyspell-mode(fun).
The mode's hook is called both when the mode is enabled and when it is disabled.
Probably introduced at or before Emacs version 20.3.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/textmodes/flyspell.el.gz
;;*---------------------------------------------------------------------*/
;;* flyspell-mode ... */
;;*---------------------------------------------------------------------*/
;;;###autoload(defvar flyspell-mode nil "Non-nil if Flyspell mode is enabled.")
;;;###autoload
(define-minor-mode flyspell-mode
"Toggle on-the-fly spell checking (Flyspell mode).
Flyspell mode is a buffer-local minor mode. When enabled, it
spawns a single Ispell process and checks each word. The default
flyspell behavior is to highlight incorrect words.
This mode is geared toward text modes. In buffers that contain
code, `flyspell-prog-mode' is usually a better choice.
Bindings:
\\[ispell-word]: correct words (using Ispell).
\\[flyspell-auto-correct-word]: automatically correct word.
\\[flyspell-auto-correct-previous-word]: automatically correct the last misspelled word.
\\[flyspell-correct-word] (or down-mouse-2): popup correct words.
Hooks:
This runs `flyspell-mode-hook' after flyspell mode is entered or exit.
Remark:
`flyspell-mode' uses `ispell-mode'. Thus all Ispell options are
valid. For instance, a different dictionary can be used by
invoking `ispell-change-dictionary'.
Consider using the `ispell-parser' to check your text. For instance
consider adding:
\(add-hook \\='tex-mode-hook (lambda () (setq ispell-parser \\='tex)))
in your init file.
\\[flyspell-region] checks all words inside a region.
\\[flyspell-buffer] checks the whole buffer."
:lighter (flyspell-mode-line-string
;; If `flyspell-mode-line-string' is nil, then nothing of
;; the following is displayed in the mode line.
((:propertize flyspell-mode-line-string)
(:propertize
(:eval
(concat "/" (substring (or ispell-local-dictionary
ispell-dictionary
"--")
0 2)))
help-echo "mouse-1: Change dictionary"
local-map (keymap
(mode-line keymap
(mouse-1 . ispell-change-dictionary))))))
:keymap flyspell-mode-map
:group 'flyspell
(if flyspell-mode
(condition-case err
(flyspell--mode-on (called-interactively-p 'interactive))
(error (message "Error enabling Flyspell mode:\n%s" (cdr err))
(flyspell-mode -1)))
(flyspell--mode-off)))