diff options
| author | Eli Zaretskii | 2018-03-03 12:47:47 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2018-03-03 12:47:47 +0200 |
| commit | b80e15b6a6d06fc2937a9c11c1cae5619ceed9c3 (patch) | |
| tree | b341286beef76d92d8b0b7414b07c74e4b1e5a98 /lisp | |
| parent | e385599457497d0ad1a103363eec73e09058c24a (diff) | |
| download | emacs-b80e15b6a6d06fc2937a9c11c1cae5619ceed9c3.tar.gz emacs-b80e15b6a6d06fc2937a9c11c1cae5619ceed9c3.zip | |
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)
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/textmodes/flyspell.el | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index d87cb5e72ed..e4626696262 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el | |||
| @@ -1944,6 +1944,10 @@ spell-check." | |||
| 1944 | (call-interactively flyspell--prev-meta-tab-binding) | 1944 | (call-interactively flyspell--prev-meta-tab-binding) |
| 1945 | (let ((pos (point)) | 1945 | (let ((pos (point)) |
| 1946 | (old-max (point-max))) | 1946 | (old-max (point-max))) |
| 1947 | ;; Flush a possibly stale cache from previous invocations of | ||
| 1948 | ;; flyspell-auto-correct-word. | ||
| 1949 | (if (not (eq last-command 'flyspell-auto-correct-word)) | ||
| 1950 | (setq flyspell-auto-correct-region nil)) | ||
| 1947 | ;; Use the correct dictionary. | 1951 | ;; Use the correct dictionary. |
| 1948 | (flyspell-accept-buffer-local-defs) | 1952 | (flyspell-accept-buffer-local-defs) |
| 1949 | (if (and (eq flyspell-auto-correct-pos pos) | 1953 | (if (and (eq flyspell-auto-correct-pos pos) |