]> git.eshelyaron.com Git - emacs.git/commitdiff
Better support for 'transpose-chars' in Flyspell mode
authorAaron Jensen <aaronjensen@gmail.com>
Wed, 14 Mar 2018 15:09:50 +0000 (08:09 -0700)
committerEli Zaretskii <eliz@gnu.org>
Tue, 20 Mar 2018 15:09:04 +0000 (17:09 +0200)
* lisp/textmodes/flyspell.el (flyspell-post-command-hook): Check
word  before previous point location after 'transpose-chars'.
(Bug#30813)

lisp/textmodes/flyspell.el

index e46266962625ad4ad73d98ad6122265a8947eded..b5c841403a19fbc6e1cc6c973d36bcabcd0967a1 100644 (file)
@@ -982,6 +982,11 @@ Mostly we check word delimiters."
       (let ((command this-command)
             ;; Prevent anything we do from affecting the mark.
             deactivate-mark)
+        (if (and (eq command 'transpose-chars)
+                 flyspell-pre-point)
+            (save-excursion
+              (goto-char (- flyspell-pre-point 1))
+              (flyspell-word)))
         (if (flyspell-check-pre-word-p)
             (save-excursion
               '(flyspell-debug-signal-pre-word-checked)