]> code.delx.au - gnu-emacs/commitdiff
textmodes/flyspell.el (flyspell-word): Consider words that differ only
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Thu, 30 Jun 2011 23:19:45 +0000 (01:19 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Thu, 30 Jun 2011 23:19:45 +0000 (01:19 +0200)
in case as potential doublons (bug#5687).

lisp/ChangeLog
lisp/textmodes/flyspell.el

index c1c213d1440f3ee8b53581ddfcf720233f8316d5..1ce1eb61f14705898736e2edeacbdba9c392cf8d 100644 (file)
@@ -1,5 +1,8 @@
 2011-06-30  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * textmodes/flyspell.el (flyspell-word): Consider words that
+       differ only in case as potential doublons (bug#5687).
+
        * net/soap-client.el (soap-invoke, soap-wsdl-resolve-references):
        Remove two rather uninteresting debugging-like messages to make
        debbugs.el more silent.
index bc8644be7862982cd2945589278e88045cce882d..7bb3323eb176294a760d11ea19046bef8ba8d7a1 100644 (file)
@@ -993,14 +993,17 @@ Mostly we check word delimiters."
 ;;*---------------------------------------------------------------------*/
 ;;*    flyspell-word-search-backward ...                                */
 ;;*---------------------------------------------------------------------*/
-(defun flyspell-word-search-backward (word bound)
+(defun flyspell-word-search-backward (word bound &optional ignore-case)
   (save-excursion
     (let ((r '())
          (inhibit-point-motion-hooks t)
          p)
       (while (and (not r) (setq p (search-backward word bound t)))
        (let ((lw (flyspell-get-word)))
-         (if (and (consp lw) (string-equal (car lw) word))
+         (if (and (consp lw)
+                  (if ignore-case
+                      (equalp (car lw) word)
+                    (string-equal (car lw) word)))
              (setq r p)
            (goto-char p))))
       r)))
@@ -1069,7 +1072,7 @@ misspelling and skips redundant spell-checking step."
                              (- end start)
                              (- (skip-chars-backward " \t\n\f"))))
                          (p (when (>= bound (point-min))
-                              (flyspell-word-search-backward word bound))))
+                              (flyspell-word-search-backward word bound t))))
                     (and p (/= p start)))))
            ;; yes, this is a doublon
            (flyspell-highlight-incorrect-region start end 'doublon)