emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-26 b80e15b: Prevent Flyspell from changing unrelated


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-26 b80e15b: Prevent Flyspell from changing unrelated words
Date: Sat, 3 Mar 2018 05:48:15 -0500 (EST)

branch: emacs-26
commit b80e15b6a6d06fc2937a9c11c1cae5619ceed9c3
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Prevent Flyspell from changing unrelated words
    
    * lisp/textmodes/flyspell.el (flyspell-auto-correct-word): Avoid
    using stale cached data from previous invocations of this command.
    (Bug#30462)
---
 lisp/textmodes/flyspell.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index d87cb5e..e462669 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -1944,6 +1944,10 @@ spell-check."
       (call-interactively flyspell--prev-meta-tab-binding)
     (let ((pos     (point))
           (old-max (point-max)))
+      ;; Flush a possibly stale cache from previous invocations of
+      ;; flyspell-auto-correct-word.
+      (if (not (eq last-command 'flyspell-auto-correct-word))
+          (setq flyspell-auto-correct-region nil))
       ;; Use the correct dictionary.
       (flyspell-accept-buffer-local-defs)
       (if (and (eq flyspell-auto-correct-pos pos)



reply via email to

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