1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-26 07:33:47 +00:00

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)
This commit is contained in:
Eli Zaretskii 2018-03-03 12:47:47 +02:00
parent e385599457
commit b80e15b6a6

View File

@ -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)