From 887d14add7ac21ae466f37208f347f860db33765 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Fri, 1 Jul 2011 01:19:45 +0200 Subject: [PATCH] textmodes/flyspell.el (flyspell-word): Consider words that differ only in case as potential doublons (bug#5687). --- lisp/ChangeLog | 3 +++ lisp/textmodes/flyspell.el | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c1c213d1440..1ce1eb61f14 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2011-06-30 Lars Magne Ingebrigtsen + * 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. diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index bc8644be786..7bb3323eb17 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -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)