]> 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)
committerAndrew G Cohen <cohen@andy.bu.edu>
Tue, 11 Dec 2018 06:17:52 +0000 (14:17 +0800)
* 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)