;;; flyspell.el --- on-the-fly spell checker
;; Copyright (C) 1998, 2000, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007 Free Software Foundation, Inc.
+;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: Manuel Serrano <Manuel.Serrano@sophia.inria.fr>
;; Maintainer: FSF
;; This file is part of GNU Emacs.
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
0 means do not search for duplicate unrecognized spellings."
:group 'flyspell
:version "21.1"
- :type 'number)
+ :type '(choice (const :tag "no limit" -1)
+ number))
(defcustom flyspell-delay 3
"The number of seconds to wait before checking, after a \"delayed\" command."
;;*--- sgml mode -------------------------------------------------------*/
(put 'sgml-mode 'flyspell-mode-predicate 'sgml-mode-flyspell-verify)
(put 'html-mode 'flyspell-mode-predicate 'sgml-mode-flyspell-verify)
+(put 'nxml-mode 'flyspell-mode-predicate 'sgml-mode-flyspell-verify)
(defun sgml-mode-flyspell-verify ()
"Function used for `flyspell-generic-check-word-predicate' in SGML mode."
\\[flyspell-correct-word] (or down-mouse-2): popup correct words.
Hooks:
-This runs `flyspell-mode-hook' after flyspell is entered.
+This runs `flyspell-mode-hook' after flyspell mode is entered or exit.
Remark:
`flyspell-mode' uses `ispell-mode'. Thus all Ispell options are
;;*---------------------------------------------------------------------*/
(defun flyspell-mode-on ()
"Turn Flyspell mode on. Do not use this; use `flyspell-mode' instead."
- (ispell-maybe-find-aspell-dictionaries)
+ (ispell-set-spellchecker-params) ; Initialize variables and dicts alists
(setq ispell-highlight-face 'flyspell-incorrect)
;; local dictionaries setup
(or ispell-local-dictionary ispell-dictionary
(if binding
(format "Welcome to flyspell. Use %s or Mouse-2 to correct words."
(key-description binding))
- "Welcome to flyspell. Use Mouse-2 to correct words."))))
- ;; we end with the flyspell hooks
- (run-hooks 'flyspell-mode-hook))
+ "Welcome to flyspell. Use Mouse-2 to correct words.")))))
;;*---------------------------------------------------------------------*/
;;* flyspell-delay-commands ... */
(defun flyspell-word (&optional following)
"Spell check a word."
(interactive (list ispell-following-word))
+ (ispell-set-spellchecker-params) ; Initialize variables and dicts alists
(save-excursion
;; use the correct dictionary
(flyspell-accept-buffer-local-defs)
;; this is done, we can start checking...
(if flyspell-issue-message-flag (message "Checking region..."))
(set-buffer curbuf)
- (ispell-check-version)
+ (ispell-set-spellchecker-params) ; Initialize variables and dicts alists
;; Local dictionary becomes the global dictionary in use.
(setq ispell-current-dictionary
(or ispell-local-dictionary ispell-dictionary))
(defun flyspell-region (beg end)
"Flyspell text between BEG and END."
(interactive "r")
+ (ispell-set-spellchecker-params) ; Initialize variables and dicts alists
(if (= beg end)
()
(save-excursion