From: Chong Yidong <cyd@gnu.org>
Date: Sat, 13 Oct 2012 09:51:59 +0000 (+0800)
Subject: After saving ispell dictionary, re-enable flyspell if necessary.
X-Git-Tag: emacs-24.2.90~235^2~7^2~1
X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0d11ff1cf2c3af79a9c4e9ef437488b6469fca52;p=emacs.git

After saving ispell dictionary, re-enable flyspell if necessary.

* lisp/textmodes/ispell.el (ispell-pdict-save): If flyspell-mode is
enabled, re-enable it.

Fixes: debbugs:11963
---

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5ac455feb13..d58eb0bfbbf 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2012-10-13  Chong Yidong  <cyd@gnu.org>
+
+	* textmodes/ispell.el (ispell-pdict-save): If flyspell-mode is
+	enabled, re-enable it (Bug#11963).
+
 2012-10-13  Martin Rudalics  <rudalics@gmx.at>
 
 	* emacs-lisp/debug.el (debug): When debugger-will-be-back is
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 51a4800de52..d591dc5fa85 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1893,11 +1893,14 @@ If so, ask if it needs to be saved."
   (interactive (list ispell-silently-savep t))
   (if (and ispell-pdict-modified-p (listp ispell-pdict-modified-p))
       (setq ispell-pdict-modified-p (car ispell-pdict-modified-p)))
-  (if (or ispell-pdict-modified-p force-save)
-      (if (or no-query (y-or-n-p "Personal dictionary modified.  Save? "))
-	  (progn
-	    (ispell-send-string "#\n")	; save dictionary
-	    (message "Personal dictionary saved."))))
+  (when (and (or ispell-pdict-modified-p force-save)
+	     (or no-query
+		 (y-or-n-p "Personal dictionary modified.  Save? ")))
+    (ispell-send-string "#\n")	; save dictionary
+    (message "Personal dictionary saved.")
+    (when flyspell-mode
+      (flyspell-mode 0)
+      (flyspell-mode 1)))
   ;; unassert variable, even if not saved to avoid questioning.
   (setq ispell-pdict-modified-p nil))