emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/textmodes/ispell.el


From: Eli Zaretskii
Subject: [Emacs-diffs] Changes to emacs/lisp/textmodes/ispell.el
Date: Fri, 13 Jan 2006 10:45:29 +0000

Index: emacs/lisp/textmodes/ispell.el
diff -u emacs/lisp/textmodes/ispell.el:1.186 
emacs/lisp/textmodes/ispell.el:1.187
--- emacs/lisp/textmodes/ispell.el:1.186        Fri Dec 16 02:00:02 2005
+++ emacs/lisp/textmodes/ispell.el      Fri Jan 13 10:45:29 2006
@@ -202,6 +202,7 @@
 ;;; Code:
 
 (defvar mail-yank-prefix)
+(eval-when-compile (defvar flyspell-word-cache-word))
 
 ;;; Custom.el macros require recompiling this when they are not present.
 ;;; Add in backward compatible custom support.
@@ -2504,7 +2505,8 @@
       (setq ispell-filter nil ispell-filter-continue nil)
     ;; may need to restart to select new personal dictionary.
     (ispell-kill-ispell t)
-    (message "Starting new Ispell process...")
+    (message "Starting new Ispell process [%s] ..."
+            (or ispell-local-dictionary ispell-dictionary "default"))
     (sit-for 0)
     (setq ispell-library-directory (ispell-check-version)
          ispell-process-directory default-directory
@@ -2619,6 +2621,14 @@
               (setq ispell-local-dictionary dict)
               (setq ispell-local-dictionary-overridden t))
           (error "Undefined dictionary: %s" dict))
+        ;; For global setting clear out flyspell word cache when needed
+         (when (and arg
+                   (featurep 'flyspell))
+          (dolist (buf (buffer-list))
+            (with-current-buffer buf
+              (when flyspell-mode
+                (setq flyspell-word-cache-word nil)))))
+        (ispell-internal-change-dictionary)
         (message "%s Ispell dictionary set to %s"
                  (if arg "Global" "Local")
                  dict))))
@@ -2630,8 +2640,12 @@
   (let ((dict (or ispell-local-dictionary ispell-dictionary)))
     (unless (equal ispell-current-dictionary dict)
       (ispell-kill-ispell t)
-      (setq ispell-current-dictionary dict))))
-
+      (setq ispell-current-dictionary dict)
+      ;; If needed, start ispell process and clear out flyspell word cache
+      (when (and (featurep 'flyspell)
+                 flyspell-mode)
+        (ispell-init-process)
+        (setq flyspell-word-cache-word nil)))))
 
 ;;; Spelling of comments are checked when ispell-check-comments is non-nil.
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]