[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
address@hidden: Re: flyspell.el: patch for doublons checking from flyspe
From: |
Richard Stallman |
Subject: |
address@hidden: Re: flyspell.el: patch for doublons checking from flyspell-large-region] |
Date: |
Thu, 14 Sep 2006 23:14:29 -0400 |
Would someone please install this?
------- Start of forwarded message -------
Date: Thu, 14 Sep 2006 11:55:04 +0200
From: Agustin Martin <address@hidden>
To: Richard Stallman <address@hidden>
Subject: Re: flyspell.el: patch for doublons checking from flyspell-large-region
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="Dxnq1zWXvFF0Q93v"
Content-Disposition: inline
In-Reply-To: <address@hidden>
X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=failed
version=3.0.4
- --Dxnq1zWXvFF0Q93v
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
On Thu, Jun 29, 2006 at 09:00:06AM -0400, Richard Stallman wrote:
> The change looks safe enough, so if it works for you and no one
> objects in a week, let's install it.
Seems that nobody complained in two months,
I am readding proposed changelog entry and patch,
- ---------------------------------------
flyspell.el:
(flyspell-check-region-doublons)
- New function to check for adjacent duplicated words (doublons)
in the given region.
(flyspell-large-region) Use it.
- ---------------------------------------
- --
Agustin
- --Dxnq1zWXvFF0Q93v
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
filename="flyspell.el.check-large-region-doublons.diff1"
- --- 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...")))))
- --Dxnq1zWXvFF0Q93v--
------- End of forwarded message -------
- address@hidden: Re: flyspell.el: patch for doublons checking from flyspell-large-region],
Richard Stallman <=