all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Aaron Jensen <aaronjensen@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 30813@debbugs.gnu.org
Subject: bug#30813: 26.0.91; flyspell does not recheck after transpose-chars
Date: Wed, 14 Mar 2018 08:14:01 -0700	[thread overview]
Message-ID: <CAHyO48zr_Yi6rZV5rXM2e=eeRonydrkdE6PijZeqX-7K_y1XWA@mail.gmail.com> (raw)
In-Reply-To: <D328B6D7-240C-420C-93FD-BD631BE084E1@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 613 bytes --]

On Tue, Mar 13, 2018 at 10:59 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> Transposing words can create duplicate words, or fix word duplication, something
> that flyspell flags as well.

I see. There are lots of ways to break this--change the first instance
of the word in any way and the second word does not notice. It seems
like if that were to be addressed it would need to be something that
is command agnostic. Perhaps something like looking at the next word
to see if it is currently marked duplicate and if so rechecking.

In the meantime, how about the attached patch which addresses just
transpose-chars?

[-- Attachment #2: 0001-Enable-flyspell-to-check-word-point-was-at-before-tr.patch --]
[-- Type: application/octet-stream, Size: 1139 bytes --]

From d88101f30e1ddfb5fb39170c553f854758f7b1d2 Mon Sep 17 00:00:00 2001
From: Aaron Jensen <aaronjensen@gmail.com>
Date: Wed, 14 Mar 2018 08:09:50 -0700
Subject: [PATCH] Enable flyspell to check word point was at before
 transpose-chars

* lisp/textmodes/flyspell.el (flyspell-post-command-hook): Check word
  before previous point location after transpose-chars. (Bug#30813)
---
 lisp/textmodes/flyspell.el | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index e462669626..b5c841403a 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -982,6 +982,11 @@ flyspell-post-command-hook
       (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)
-- 
2.15.1


  reply	other threads:[~2018-03-14 15:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-14  0:00 bug#30813: 26.0.91; flyspell does not recheck after transpose-chars Aaron Jensen
2018-03-14  3:41 ` Eli Zaretskii
2018-03-14  4:48   ` Aaron Jensen
2018-03-14  4:56     ` Aaron Jensen
2018-03-14  5:17       ` Aaron Jensen
2018-03-14  5:28         ` Eli Zaretskii
2018-03-14  5:34           ` Aaron Jensen
2018-03-14  5:59             ` Eli Zaretskii
2018-03-14 15:14               ` Aaron Jensen [this message]
2018-03-20 15:11                 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHyO48zr_Yi6rZV5rXM2e=eeRonydrkdE6PijZeqX-7K_y1XWA@mail.gmail.com' \
    --to=aaronjensen@gmail.com \
    --cc=30813@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.