diff lisp/textmodes/flyspell.el @ 90645:7eeafaaa9eab

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 476-489) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 153-160) - Merge from emacs--devo--0 - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-127
author Miles Bader <miles@gnu.org>
date Mon, 30 Oct 2006 08:54:41 +0000
parents b5c13d1564a9 93f756e426b8
children 02cf29720f31
line wrap: on
line diff
--- a/lisp/textmodes/flyspell.el	Mon Oct 30 06:52:47 2006 +0000
+++ b/lisp/textmodes/flyspell.el	Mon Oct 30 08:54:41 2006 +0000
@@ -959,6 +959,7 @@
 (defun flyspell-word-search-backward (word bound)
   (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 '())))
@@ -973,6 +974,7 @@
 (defun flyspell-word-search-forward (word bound)
   (save-excursion
     (let ((r '())
+	  (inhibit-point-motion-hooks t)
 	  p)
       (while (and (not r) (setq p (search-forward word bound t)))
 	(let ((lw (flyspell-get-word '())))
@@ -1009,11 +1011,14 @@
 			  (not (memq (char-after (1- start)) '(?\} ?\\)))))
 		 flyspell-mark-duplications-flag
 		 (save-excursion
-		   (goto-char (1- start))
-		   (let ((p (flyspell-word-search-backward
-			     word
-			     (- start (1+ (- end start))))))
-		     (and p (/= p (1- start))))))
+		   (goto-char start)
+		   (let* ((bound
+			   (- start
+			      (- end start)
+			      (- (skip-chars-backward " \t\n\f"))))
+			  (p (when (>= bound (point-min))
+			       (flyspell-word-search-backward word bound))))
+		     (and p (/= p start)))))
 	    ;; yes, this is a doublon
 	    (flyspell-highlight-incorrect-region start end 'doublon)
 	    nil)
@@ -1470,7 +1475,7 @@
     (flyspell-word)     ; Make sure current word is checked
     (backward-word 1)
     (while (and (< (point) end)
-		(re-search-forward "\\b\\([^ \n\t]+\\)[ \n\t]+\\1\\b"
+		(re-search-forward "\\<\\(\\w+\\)\\>[ \n\t\f]+\\1\\>"
 				   end 'move))
       (flyspell-word)
       (backward-word 1))
@@ -1706,7 +1711,9 @@
 	    ;; now we can use a new overlay
 	    (setq flyspell-overlay
 		  (make-flyspell-overlay
-		   beg end 'flyspell-incorrect 'highlight)))))))
+		   beg end
+		   (if (eq poss 'doublon) 'flyspell-duplicate 'flyspell-incorrect)
+		   'highlight)))))))
 
 ;;*---------------------------------------------------------------------*/
 ;;*    flyspell-highlight-duplicate-region ...                          */