bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#21157: 24.5; Flyspell does not highlight repeated words


From: Eli Zaretskii
Subject: bug#21157: 24.5; Flyspell does not highlight repeated words
Date: Wed, 29 Jul 2015 20:53:57 +0300

> Date: Wed, 29 Jul 2015 18:11:39 +0200
> From: Florent Marchand de Kerchove <address@hidden>
> 
> 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 <address@hidden>
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 via email to

[Prev in Thread] Current Thread [Next in Thread]