[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: address@hidden: Re: flyspell.el: patch for doublons checking from fl
From: |
Chong Yidong |
Subject: |
Re: address@hidden: Re: flyspell.el: patch for doublons checking from flyspell-large-region] |
Date: |
Sat, 16 Sep 2006 11:06:15 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
Richard Stallman <address@hidden> writes:
> Would someone please install this?
Done.
> From: Agustin Martin <address@hidden>
> Subject: Re: flyspell.el: patch for doublons checking from
> flyspell-large-region
> To: Richard Stallman <address@hidden>
>
> - --- flyspell.el.orig 2006-06-28 12:01:43.000000000 +0200
> +++ flyspell.el 2006-06-29 11:33:46.000000000 +0200
> @@ -1455,6 +1455,21 @@
> (while (re-search-forward regexp nil t)
> (delete-region (match-beginning 0) (match-end 0)))))))))
>
> +;;* ---------------------------------------------------------------
> +;;* flyspell-check-region-doublons
> +;;* ---------------------------------------------------------------
> +(defun flyspell-check-region-doublons (beg end)
> + "Check for adjacent duplicated words (doublons) in the given region."
> + (save-excursion
> + (goto-char beg)
> + (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))
> + (flyspell-word)))
> +
> ;;*---------------------------------------------------------------------*/
> ;;* flyspell-large-region ... */
> ;;*---------------------------------------------------------------------*/
> @@ -1499,7 +1514,8 @@
> (progn
> (flyspell-process-localwords buffer)
> (with-current-buffer curbuf
> - - (flyspell-delete-region-overlays beg end))
> + (flyspell-delete-region-overlays beg end)
> + (flyspell-check-region-doublons beg end))
> (flyspell-external-point-words))
> (error "Can't check region...")))))
>
>