Variable: flyspell-mode

flyspell-mode is a buffer-local variable defined in flyspell.el.gz.

Documentation

Non-nil if Flyspell mode is enabled.

Use the command flyspell-mode(var)/flyspell-mode(fun) to change this variable.

View in manual

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)))