diff options
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/textmodes/flyspell.el | 7 |
2 files changed, 10 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8850bc3ea97..4c009714ce4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2006-01-15 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2006-01-15 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * textmodes/flyspell.el (flyspell-kill-ispell-hook): New fun. | ||
| 4 | (flyspell-mode-on): Use it. | ||
| 5 | |||
| 3 | * textmodes/ispell.el (ispell-kill-ispell): Run new hook | 6 | * textmodes/ispell.el (ispell-kill-ispell): Run new hook |
| 4 | ispell-kill-ispell-hook. | 7 | ispell-kill-ispell-hook. |
| 5 | 8 | ||
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index 39d4b1f7b69..665d6c59fd7 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el | |||
| @@ -525,6 +525,11 @@ in your .emacs file. | |||
| 525 | (member (or ispell-local-dictionary ispell-dictionary) | 525 | (member (or ispell-local-dictionary ispell-dictionary) |
| 526 | flyspell-dictionaries-that-consider-dash-as-word-delimiter))))) | 526 | flyspell-dictionaries-that-consider-dash-as-word-delimiter))))) |
| 527 | 527 | ||
| 528 | (defun flyspell-kill-ispell-hook () | ||
| 529 | (setq flyspell-last-buffer nil) | ||
| 530 | (dolist (buf (buffer-list)) | ||
| 531 | (kill-local-variable 'flyspell-word-cache-word))) | ||
| 532 | |||
| 528 | ;;*---------------------------------------------------------------------*/ | 533 | ;;*---------------------------------------------------------------------*/ |
| 529 | ;;* flyspell-mode-on ... */ | 534 | ;;* flyspell-mode-on ... */ |
| 530 | ;;*---------------------------------------------------------------------*/ | 535 | ;;*---------------------------------------------------------------------*/ |
| @@ -536,6 +541,8 @@ in your .emacs file. | |||
| 536 | (or ispell-local-dictionary ispell-dictionary | 541 | (or ispell-local-dictionary ispell-dictionary |
| 537 | (if flyspell-default-dictionary | 542 | (if flyspell-default-dictionary |
| 538 | (ispell-change-dictionary flyspell-default-dictionary))) | 543 | (ispell-change-dictionary flyspell-default-dictionary))) |
| 544 | ;; Make sure we flush our caches when needed. | ||
| 545 | (add-hook 'ispell-kill-ispell-hook 'flyspell-kill-ispell-hook) | ||
| 539 | ;; we have to force ispell to accept the local definition or | 546 | ;; we have to force ispell to accept the local definition or |
| 540 | ;; otherwise it could be too late, the local dictionary may | 547 | ;; otherwise it could be too late, the local dictionary may |
| 541 | ;; be forgotten! | 548 | ;; be forgotten! |