* lisp/textmodes/flyspell.el (flyspell-auto-correct-word): Keep
flyspell-auto-correct-region also when repeatedly invoking
flyspell-auto-correct-previous-word. (Bug#31188)
(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))
+ ;; flyspell-auto-correct-word/flyspell-auto-correct-previous-word.
+ (if (not (memq last-command '(flyspell-auto-correct-word
+ flyspell-auto-correct-previous-word)))
(setq flyspell-auto-correct-region nil))
;; Use the correct dictionary.
(flyspell-accept-buffer-local-defs)