all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Florent Marchand de Kerchove <fmdkdd@gmail.com>
Cc: 21157-done@debbugs.gnu.org
Subject: bug#21157: 24.5; Flyspell does not highlight repeated words
Date: Wed, 29 Jul 2015 20:53:57 +0300	[thread overview]
Message-ID: <83zj2ex32i.fsf@gnu.org> (raw)
In-Reply-To: <55B8FB3B.7060708@gmail.com>

> Date: Wed, 29 Jul 2015 18:11:39 +0200
> From: Florent Marchand de Kerchove <fmdkdd@gmail.com>
> 
> Start `emacs -Q', and turn on flyspell-mode with `M-x flyspell-mode 
> RET'.  Type `the the '.
> 
> The second `the' should be automatically highlighted by Flyspell as a
> repeated word (red squiggles under the word).  Under 24.5.1, there is no
> highlighting.

Thanks, fixed with the patch below.

commit 33b779a11fb6785944383aeeae44f77cb580ee37
Author: Eli Zaretskii <eliz@gnu.org>
Date:   Wed Jul 29 20:52:23 2015 +0300

    Resurrect highlighting of repeated words by Flyspell Mode
    
    * lisp/textmodes/flyspell.el (flyspell-word): Leave some non-word
    characters between point and the doublon candidate, so that
    flyspell-word-search-backward finds it.  (Bug#21157)

diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index 2329f29..e074918 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -1119,7 +1119,8 @@ (defun flyspell-word (&optional following known-misspelling)
 		   (let* ((bound
 			   (- start
 			      (- end start)
-			      (- (skip-chars-backward " \t\n\f"))))
+			      (- (save-excursion
+                                   (skip-chars-backward " \t\n\f")))))
 			  (p (when (>= bound (point-min))
 			       (flyspell-word-search-backward word bound t))))
 		     (and p (/= p start)))))





      reply	other threads:[~2015-07-29 17:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-29 16:11 bug#21157: 24.5; Flyspell does not highlight repeated words Florent Marchand de Kerchove
2015-07-29 17:53 ` Eli Zaretskii [this message]

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=83zj2ex32i.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=21157-done@debbugs.gnu.org \
    --cc=fmdkdd@gmail.com \
    /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.