1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 04:10:54 -08:00

(flyspell-kill-ispell-hook): New fun.

(flyspell-mode-on): Use it.
This commit is contained in:
Stefan Monnier 2006-01-15 05:46:20 +00:00
parent 2834b9b3b8
commit ef0f5f7e62
2 changed files with 10 additions and 0 deletions

View file

@ -1,5 +1,8 @@
2006-01-15 Stefan Monnier <monnier@iro.umontreal.ca>
* textmodes/flyspell.el (flyspell-kill-ispell-hook): New fun.
(flyspell-mode-on): Use it.
* textmodes/ispell.el (ispell-kill-ispell): Run new hook
ispell-kill-ispell-hook.

View file

@ -525,6 +525,11 @@ in your .emacs file.
(member (or ispell-local-dictionary ispell-dictionary)
flyspell-dictionaries-that-consider-dash-as-word-delimiter)))))
(defun flyspell-kill-ispell-hook ()
(setq flyspell-last-buffer nil)
(dolist (buf (buffer-list))
(kill-local-variable 'flyspell-word-cache-word)))
;;*---------------------------------------------------------------------*/
;;* flyspell-mode-on ... */
;;*---------------------------------------------------------------------*/
@ -536,6 +541,8 @@ in your .emacs file.
(or ispell-local-dictionary ispell-dictionary
(if flyspell-default-dictionary
(ispell-change-dictionary flyspell-default-dictionary)))
;; Make sure we flush our caches when needed.
(add-hook 'ispell-kill-ispell-hook 'flyspell-kill-ispell-hook)
;; we have to force ispell to accept the local definition or
;; otherwise it could be too late, the local dictionary may
;; be forgotten!