aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2006-10-22 21:29:33 +0000
committerChong Yidong2006-10-22 21:29:33 +0000
commit6b8aed24fe5456035382e6ecdea49e772936ce50 (patch)
tree92d2bf240453c47eef30333b3d6c5a6cb13d042d
parent224ca9c976305d1fa2d3d1c38dbd2e687488b167 (diff)
downloademacs-6b8aed24fe5456035382e6ecdea49e772936ce50.tar.gz
emacs-6b8aed24fe5456035382e6ecdea49e772936ce50.zip
* textmodes/flyspell.el (flyspell-word): Skip past all previous
whitespace when checking doublons. (flyspell-check-region-doublons): Fix doublon regexp. (flyspell-highlight-incorrect-region): Highlight doublons using flyspell-duplicate face.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/textmodes/flyspell.el19
2 files changed, 18 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ba5843541a4..b92bf13b0c3 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,11 @@
12006-10-22 martin rudalics <rudalics@gmx.at> 12006-10-22 martin rudalics <rudalics@gmx.at>
2 2
3 * textmodes/flyspell.el (flyspell-word): Skip past all previous
4 whitespace when checking doublons.
5 (flyspell-check-region-doublons): Fix doublon regexp.
6 (flyspell-highlight-incorrect-region): Highlight doublons using
7 flyspell-duplicate face.
8
3 * progmodes/cperl-mode.el (cperl-invalid-face): Fix defcustom. 9 * progmodes/cperl-mode.el (cperl-invalid-face): Fix defcustom.
4 10
52006-10-22 John Wiegley <johnw@newartisans.com> 112006-10-22 John Wiegley <johnw@newartisans.com>
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index e7b95c9619d..e452716d83d 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -1011,11 +1011,14 @@ Mostly we check word delimiters."
1011 (not (memq (char-after (1- start)) '(?\} ?\\))))) 1011 (not (memq (char-after (1- start)) '(?\} ?\\)))))
1012 flyspell-mark-duplications-flag 1012 flyspell-mark-duplications-flag
1013 (save-excursion 1013 (save-excursion
1014 (goto-char (1- start)) 1014 (goto-char start)
1015 (let ((p (flyspell-word-search-backward 1015 (let* ((bound
1016 word 1016 (- start
1017 (- start (1+ (- end start)))))) 1017 (- end start)
1018 (and p (/= p (1- start)))))) 1018 (- (skip-chars-backward " \t\n\f"))))
1019 (p (when (>= bound (point-min))
1020 (flyspell-word-search-backward word bound))))
1021 (and p (/= p start)))))
1019 ;; yes, this is a doublon 1022 ;; yes, this is a doublon
1020 (flyspell-highlight-incorrect-region start end 'doublon) 1023 (flyspell-highlight-incorrect-region start end 'doublon)
1021 nil) 1024 nil)
@@ -1472,7 +1475,7 @@ The buffer to mark them in is `flyspell-large-region-buffer'."
1472 (flyspell-word) ; Make sure current word is checked 1475 (flyspell-word) ; Make sure current word is checked
1473 (backward-word 1) 1476 (backward-word 1)
1474 (while (and (< (point) end) 1477 (while (and (< (point) end)
1475 (re-search-forward "\\b\\([^ \n\t]+\\)[ \n\t]+\\1\\b" 1478 (re-search-forward "\\(\\w+\\)\\s-+\\1\\>"
1476 end 'move)) 1479 end 'move))
1477 (flyspell-word) 1480 (flyspell-word)
1478 (backward-word 1)) 1481 (backward-word 1))
@@ -1708,7 +1711,9 @@ is itself incorrect, but suspiciously repeated."
1708 ;; now we can use a new overlay 1711 ;; now we can use a new overlay
1709 (setq flyspell-overlay 1712 (setq flyspell-overlay
1710 (make-flyspell-overlay 1713 (make-flyspell-overlay
1711 beg end 'flyspell-incorrect 'highlight))))))) 1714 beg end
1715 (if (eq poss 'doublon) 'flyspell-duplicate 'flyspell-incorrect)
1716 'highlight)))))))
1712 1717
1713;;*---------------------------------------------------------------------*/ 1718;;*---------------------------------------------------------------------*/
1714;;* flyspell-highlight-duplicate-region ... */ 1719;;* flyspell-highlight-duplicate-region ... */