comparison lisp/textmodes/flyspell.el @ 68196:9b4c8f5efab7

(flyspell-kill-ispell-hook): New fun. (flyspell-mode-on): Use it.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sun, 15 Jan 2006 05:46:20 +0000
parents 5770fac9a117
children 979bd3539a58
comparison
equal deleted inserted replaced
68195:bb2dfb332355 68196:9b4c8f5efab7
523 (setq flyspell-dash-local-dictionary ispell-local-dictionary) 523 (setq flyspell-dash-local-dictionary ispell-local-dictionary)
524 (setq flyspell-consider-dash-as-word-delimiter-flag 524 (setq flyspell-consider-dash-as-word-delimiter-flag
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 ;;*---------------------------------------------------------------------*/
531 (defun flyspell-mode-on () 536 (defun flyspell-mode-on ()
532 "Turn Flyspell mode on. Do not use this; use `flyspell-mode' instead." 537 "Turn Flyspell mode on. Do not use this; use `flyspell-mode' instead."
534 (setq ispell-highlight-face 'flyspell-incorrect) 539 (setq ispell-highlight-face 'flyspell-incorrect)
535 ;; local dictionaries setup 540 ;; local dictionaries setup
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!
542 ;; Pass the `force' argument for the case where flyspell was active already 549 ;; Pass the `force' argument for the case where flyspell was active already
543 ;; but the buffer's local-defs have been edited. 550 ;; but the buffer's local-defs have been edited.