comparison lisp/textmodes/flyspell.el @ 68237:aa1b3e649cc8

(ispell-kill-ispell-hook): Add to the hook when loading the file rather than when turning on flyspell-mode.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 17 Jan 2006 16:35:52 +0000
parents 979bd3539a58
children e5fac4fecc67 d88caeac70d7
comparison
equal deleted inserted replaced
68236:310a829d776f 68237:aa1b3e649cc8
529 (setq flyspell-last-buffer nil) 529 (setq flyspell-last-buffer nil)
530 (dolist (buf (buffer-list)) 530 (dolist (buf (buffer-list))
531 (with-current-buffer buf 531 (with-current-buffer buf
532 (kill-local-variable 'flyspell-word-cache-word)))) 532 (kill-local-variable 'flyspell-word-cache-word))))
533 533
534 ;; Make sure we flush our caches when needed. Do it here rather than in
535 ;; flyspell-mode-on, since flyspell-region may be used without ever turning
536 ;; on flyspell-mode.
537 (add-hook 'ispell-kill-ispell-hook 'flyspell-kill-ispell-hook)
538
534 ;;*---------------------------------------------------------------------*/ 539 ;;*---------------------------------------------------------------------*/
535 ;;* flyspell-mode-on ... */ 540 ;;* flyspell-mode-on ... */
536 ;;*---------------------------------------------------------------------*/ 541 ;;*---------------------------------------------------------------------*/
537 (defun flyspell-mode-on () 542 (defun flyspell-mode-on ()
538 "Turn Flyspell mode on. Do not use this; use `flyspell-mode' instead." 543 "Turn Flyspell mode on. Do not use this; use `flyspell-mode' instead."
540 (setq ispell-highlight-face 'flyspell-incorrect) 545 (setq ispell-highlight-face 'flyspell-incorrect)
541 ;; local dictionaries setup 546 ;; local dictionaries setup
542 (or ispell-local-dictionary ispell-dictionary 547 (or ispell-local-dictionary ispell-dictionary
543 (if flyspell-default-dictionary 548 (if flyspell-default-dictionary
544 (ispell-change-dictionary flyspell-default-dictionary))) 549 (ispell-change-dictionary flyspell-default-dictionary)))
545 ;; Make sure we flush our caches when needed.
546 (add-hook 'ispell-kill-ispell-hook 'flyspell-kill-ispell-hook)
547 ;; we have to force ispell to accept the local definition or 550 ;; we have to force ispell to accept the local definition or
548 ;; otherwise it could be too late, the local dictionary may 551 ;; otherwise it could be too late, the local dictionary may
549 ;; be forgotten! 552 ;; be forgotten!
550 ;; Pass the `force' argument for the case where flyspell was active already 553 ;; Pass the `force' argument for the case where flyspell was active already
551 ;; but the buffer's local-defs have been edited. 554 ;; but the buffer's local-defs have been edited.