From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: [agustin.martin@hispalinux.es: Re: flyspell.el: patch for doublons checking from flyspell-large-region] Date: Thu, 14 Sep 2006 23:14:29 -0400 Message-ID: Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1158290117 28092 80.91.229.2 (15 Sep 2006 03:15:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 15 Sep 2006 03:15:17 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 15 05:15:16 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GO4Ac-0001oP-HA for ged-emacs-devel@m.gmane.org; Fri, 15 Sep 2006 05:15:14 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GO4Ac-0005xS-1F for ged-emacs-devel@m.gmane.org; Thu, 14 Sep 2006 23:15:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GO49v-0005fA-Gj for emacs-devel@gnu.org; Thu, 14 Sep 2006 23:14:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GO49v-0005eb-4Y for emacs-devel@gnu.org; Thu, 14 Sep 2006 23:14:31 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GO49u-0005eW-QF for emacs-devel@gnu.org; Thu, 14 Sep 2006 23:14:30 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GO4Bz-0006GA-Ot for emacs-devel@gnu.org; Thu, 14 Sep 2006 23:16:39 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1GO49t-0006G9-U0; Thu, 14 Sep 2006 23:14:30 -0400 Original-To: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:59851 Archived-At: Would someone please install this? ------- Start of forwarded message ------- Date: Thu, 14 Sep 2006 11:55:04 +0200 From: Agustin Martin To: Richard Stallman 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: 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 -------