unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [agustin.martin@hispalinux.es: Re: flyspell.el: patch for doublons checking from flyspell-large-region]
@ 2006-09-15  3:14 Richard Stallman
  2006-09-16 15:06 ` Chong Yidong
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Stallman @ 2006-09-15  3:14 UTC (permalink / raw)


Would someone please install this?

------- Start of forwarded message -------
Date: Thu, 14 Sep 2006 11:55:04 +0200
From: Agustin Martin <agustin.martin@hispalinux.es>
To: Richard Stallman <rms@gnu.org>
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: <E1Fvw7q-0007wt-9A@fencepost.gnu.org>
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 -------

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [agustin.martin@hispalinux.es: Re: flyspell.el: patch for doublons checking from flyspell-large-region]
  2006-09-15  3:14 [agustin.martin@hispalinux.es: Re: flyspell.el: patch for doublons checking from flyspell-large-region] Richard Stallman
@ 2006-09-16 15:06 ` Chong Yidong
  0 siblings, 0 replies; 2+ messages in thread
From: Chong Yidong @ 2006-09-16 15:06 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

> Would someone please install this?

Done.

> From: Agustin Martin <agustin.martin@hispalinux.es>
> Subject: Re: flyspell.el: patch for doublons checking from flyspell-large-region
> To: Richard Stallman <rms@gnu.org>
>
> - --- 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...")))))
>  
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-09-16 15:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-15  3:14 [agustin.martin@hispalinux.es: Re: flyspell.el: patch for doublons checking from flyspell-large-region] Richard Stallman
2006-09-16 15:06 ` Chong Yidong

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).