aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2006-01-13 10:46:09 +0000
committerEli Zaretskii2006-01-13 10:46:09 +0000
commitfc8a237d21aab7ab29229aa2910f9c46871cb865 (patch)
treeb46a356c4032b4c92998b9aa4dc45c20073053bd
parentdefe3b4124e263193942fef1482de1462240fb51 (diff)
downloademacs-fc8a237d21aab7ab29229aa2910f9c46871cb865.tar.gz
emacs-fc8a237d21aab7ab29229aa2910f9c46871cb865.zip
(ispell-init-process): Include the used dictionary in ispell process
start message. (ispell-internal-change-dictionary): When flyspell-mode is active and dictionary is changed, make sure ispell process is restarted and flyspell word cache cleared out for the current buffer. (ispell-change-dictionary): Make sure flyspell word cache is cleared out in all buffers with active flyspell mode when dictionary is globally changed. Call ispell-internal-change-dictionary after dictionary change.
-rw-r--r--lisp/ChangeLog12
-rw-r--r--lisp/textmodes/ispell.el20
2 files changed, 29 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e540848c181..2abf4980f6b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,15 @@
12006-01-13 Agustin Martin <agustin.martin@hispalinux.es>
2
3 * textmodes/ispell.el (ispell-init-process): Include the used
4 dictionary in ispell process start message.
5 (ispell-internal-change-dictionary): When flyspell-mode is active
6 and dictionary is changed, make sure ispell process is restarted
7 and flyspell word cache cleared out for the current buffer.
8 (ispell-change-dictionary): Make sure flyspell word cache is
9 cleared out in all buffers with active flyspell mode when
10 dictionary is globally changed. Call
11 ispell-internal-change-dictionary after dictionary change.
12
12006-01-13 Eli Zaretskii <eliz@gnu.org> 132006-01-13 Eli Zaretskii <eliz@gnu.org>
2 14
3 * emacs-lisp/bytecomp.el (batch-byte-recompile-directory): Doc fix. 15 * emacs-lisp/bytecomp.el (batch-byte-recompile-directory): Doc fix.
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 42c773240c6..5f3691842ba 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -202,6 +202,7 @@
202;;; Code: 202;;; Code:
203 203
204(defvar mail-yank-prefix) 204(defvar mail-yank-prefix)
205(eval-when-compile (defvar flyspell-word-cache-word))
205 206
206;;; Custom.el macros require recompiling this when they are not present. 207;;; Custom.el macros require recompiling this when they are not present.
207;;; Add in backward compatible custom support. 208;;; Add in backward compatible custom support.
@@ -2504,7 +2505,8 @@ Keeps argument list for future ispell invocations for no async support."
2504 (setq ispell-filter nil ispell-filter-continue nil) 2505 (setq ispell-filter nil ispell-filter-continue nil)
2505 ;; may need to restart to select new personal dictionary. 2506 ;; may need to restart to select new personal dictionary.
2506 (ispell-kill-ispell t) 2507 (ispell-kill-ispell t)
2507 (message "Starting new Ispell process...") 2508 (message "Starting new Ispell process [%s] ..."
2509 (or ispell-local-dictionary ispell-dictionary "default"))
2508 (sit-for 0) 2510 (sit-for 0)
2509 (setq ispell-library-directory (ispell-check-version) 2511 (setq ispell-library-directory (ispell-check-version)
2510 ispell-process-directory default-directory 2512 ispell-process-directory default-directory
@@ -2619,6 +2621,14 @@ By just answering RET you can find out what the current dictionary is."
2619 (setq ispell-local-dictionary dict) 2621 (setq ispell-local-dictionary dict)
2620 (setq ispell-local-dictionary-overridden t)) 2622 (setq ispell-local-dictionary-overridden t))
2621 (error "Undefined dictionary: %s" dict)) 2623 (error "Undefined dictionary: %s" dict))
2624 ;; For global setting clear out flyspell word cache when needed
2625 (when (and arg
2626 (featurep 'flyspell))
2627 (dolist (buf (buffer-list))
2628 (with-current-buffer buf
2629 (when flyspell-mode
2630 (setq flyspell-word-cache-word nil)))))
2631 (ispell-internal-change-dictionary)
2622 (message "%s Ispell dictionary set to %s" 2632 (message "%s Ispell dictionary set to %s"
2623 (if arg "Global" "Local") 2633 (if arg "Global" "Local")
2624 dict)))) 2634 dict))))
@@ -2630,8 +2640,12 @@ a new one will be started when needed."
2630 (let ((dict (or ispell-local-dictionary ispell-dictionary))) 2640 (let ((dict (or ispell-local-dictionary ispell-dictionary)))
2631 (unless (equal ispell-current-dictionary dict) 2641 (unless (equal ispell-current-dictionary dict)
2632 (ispell-kill-ispell t) 2642 (ispell-kill-ispell t)
2633 (setq ispell-current-dictionary dict)))) 2643 (setq ispell-current-dictionary dict)
2634 2644 ;; If needed, start ispell process and clear out flyspell word cache
2645 (when (and (featurep 'flyspell)
2646 flyspell-mode)
2647 (ispell-init-process)
2648 (setq flyspell-word-cache-word nil)))))
2635 2649
2636;;; Spelling of comments are checked when ispell-check-comments is non-nil. 2650;;; Spelling of comments are checked when ispell-check-comments is non-nil.
2637 2651