--- ispell.el.orig0 2005-12-20 15:06:29.000000000 +0100 +++ ispell.el 2006-01-09 13:22:27.000000000 +0100 @@ -2504,7 +2504,8 @@ (setq ispell-filter nil ispell-filter-continue nil) ;; may need to restart to select new personal dictionary. (ispell-kill-ispell t) - (message "Starting new Ispell process...") + (message "Starting new Ispell process [%s] ..." + (or ispell-local-dictionary ispell-dictionary "default")) (sit-for 0) (setq ispell-library-directory (ispell-check-version) ispell-process-directory default-directory @@ -2619,6 +2620,14 @@ (setq ispell-local-dictionary dict) (setq ispell-local-dictionary-overridden t)) (error "Undefined dictionary: %s" dict)) + ;; For global setting clear out flyspell word cache when needed + (when (and arg + (featurep 'flyspell)) + (dolist (buf (buffer-list)) + (with-current-buffer buf + (when flyspell-mode + (setq flyspell-word-cache-word nil))))) + (ispell-internal-change-dictionary) (message "%s Ispell dictionary set to %s" (if arg "Global" "Local") dict)))) @@ -2630,8 +2639,13 @@ (let ((dict (or ispell-local-dictionary ispell-dictionary))) (unless (equal ispell-current-dictionary dict) (ispell-kill-ispell t) - (setq ispell-current-dictionary dict)))) - + (setq ispell-current-dictionary dict) + ;; If needed, start ispell process and clear out flyspell word cache + (when (featurep 'flyspell) + (setq flyspell-last-buffer nil) ;; re-read buffer-local-defs + (when flyspell-mode + (ispell-init-process) + (setq flyspell-word-cache-word nil)))))) ;;; Spelling of comments are checked when ispell-check-comments is non-nil.