[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: address@hidden: flyspell bug]
From: |
martin rudalics |
Subject: |
Re: address@hidden: flyspell bug] |
Date: |
Mon, 23 Oct 2006 08:17:30 +0200 |
User-agent: |
Mozilla Thunderbird 1.0 (Windows/20041206) |
> The patch looks right; I've checked it in.
Konrad has detected a bug in it:
>> However there is a new bug now: Duplicated words that are separated by
>> a newline-character (e.g. "bug" at the end of some line and "bug" at
>> the beginning of the following line) are no longer detected.
Attached find a version that hopefully resolves this. I apologize for
the inconvenience.
*** flyspell.el Sat Oct 21 11:36:32 2006
--- flyspell.el Sun Oct 22 22:10:54 2006
***************
*** 1011,1021 ****
(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))))))
;; yes, this is a doublon
(flyspell-highlight-incorrect-region start end 'doublon)
nil)
--- 1011,1022 ----
(not (memq (char-after (1- start)) '(?\} ?\\)))))
flyspell-mark-duplications-flag
(save-excursion
! (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)
***************
*** 1472,1478 ****
(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"
end 'move))
(flyspell-word)
(backward-word 1))
--- 1473,1479 ----
(flyspell-word) ; Make sure current word is checked
(backward-word 1)
(while (and (< (point) end)
! (re-search-forward "\\<\\(\\w+\\)\\>[ \n\t\f]+\\1\\>"
end 'move))
(flyspell-word)
(backward-word 1))
***************
*** 1708,1714 ****
;; now we can use a new overlay
(setq flyspell-overlay
(make-flyspell-overlay
! beg end 'flyspell-incorrect 'highlight)))))))
;;*---------------------------------------------------------------------*/
;;* flyspell-highlight-duplicate-region ... */
--- 1709,1717 ----
;; now we can use a new overlay
(setq flyspell-overlay
(make-flyspell-overlay
! beg end
! (if (eq poss 'doublon) 'flyspell-duplicate
'flyspell-incorrect)
! 'highlight)))))))
;;*---------------------------------------------------------------------*/
;;* flyspell-highlight-duplicate-region ... */