unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
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	[thread overview]
Message-ID: <E1GO49t-0006G9-U0@fencepost.gnu.org> (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 -------

             reply	other threads:[~2006-09-15  3:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-15  3:14 Richard Stallman [this message]
2006-09-16 15:06 ` [agustin.martin@hispalinux.es: Re: flyspell.el: patch for doublons checking from flyspell-large-region] Chong Yidong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1GO49t-0006G9-U0@fencepost.gnu.org \
    --to=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).