diff lisp/textmodes/flyspell.el @ 94303:e0b01f455de0

* ispell.el (ispell-set-spellchecker-params): New function to make sure right params and dictionary alists are used after spellchecker changes. (ispell-aspell-dictionary-alist, ispell-last-program-name) (ispell-initialize-spellchecker-hook): New variables and hook. (ispell-find-aspell-dictionaries): Use ispell-aspell-dictionary-alist. (ispell-maybe-find-aspell-dictionaries): Remove. Calls replaced by (ispell-set-spellchecker-params) calls. (ispell-have-aspell-dictionaries): Remove. * flyspell.el: Replace ispell-maybe-find-aspell-dictionaries by ispell-set-spellchecker-params.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 23 Apr 2008 20:39:10 +0000
parents 7aae3fb72148
children 9e177181ff37
line wrap: on
line diff
--- a/lisp/textmodes/flyspell.el	Wed Apr 23 18:39:22 2008 +0000
+++ b/lisp/textmodes/flyspell.el	Wed Apr 23 20:39:10 2008 +0000
@@ -579,7 +579,7 @@
 ;;*---------------------------------------------------------------------*/
 (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
@@ -1017,6 +1017,7 @@
 (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)
@@ -1532,7 +1533,7 @@
     ;; 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))
@@ -1591,6 +1592,7 @@
 (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