[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/textmodes/flyspell.el,v
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/textmodes/flyspell.el,v |
Date: |
Sat, 09 Dec 2006 13:02:33 +0000 |
CVSROOT: /cvsroot/emacs
Module name: emacs
Changes by: Eli Zaretskii <eliz> 06/12/09 13:02:33
Index: flyspell.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/textmodes/flyspell.el,v
retrieving revision 1.113
retrieving revision 1.114
diff -u -b -r1.113 -r1.114
--- flyspell.el 9 Dec 2006 03:56:54 -0000 1.113
+++ flyspell.el 9 Dec 2006 13:02:32 -0000 1.114
@@ -541,6 +541,11 @@
(member (or ispell-local-dictionary ispell-dictionary)
flyspell-dictionaries-that-consider-dash-as-word-delimiter)))))
+(defun flyspell-hack-local-variables-hook ()
+ ;; When local variables are loaded, see if the dictionary context
+ ;; has changed.
+ (flyspell-accept-buffer-local-defs 'force))
+
(defun flyspell-kill-ispell-hook ()
(setq flyspell-last-buffer nil)
(dolist (buf (buffer-list))
@@ -579,6 +584,9 @@
(add-hook 'pre-command-hook (function flyspell-pre-command-hook) t t)
;; we bound flyspell action to after-change hook
(add-hook 'after-change-functions 'flyspell-after-change-function nil t)
+ ;; we bound flyspell action to hack-local-variables-hook
+ (add-hook 'hack-local-variables-hook
+ (function flyspell-hack-local-variables-hook) t t)
;; set flyspell-generic-check-word-predicate based on the major mode
(let ((mode-predicate (get major-mode 'flyspell-mode-predicate)))
(if mode-predicate
@@ -684,6 +692,8 @@
(remove-hook 'post-command-hook (function flyspell-post-command-hook) t)
(remove-hook 'pre-command-hook (function flyspell-pre-command-hook) t)
(remove-hook 'after-change-functions 'flyspell-after-change-function t)
+ (remove-hook 'hack-local-variables-hook
+ (function flyspell-hack-local-variables-hook) t)
;; we remove all the flyspell hilightings
(flyspell-delete-all-overlays)
;; we have to erase pre cache variables