From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: michael@cadilhac.name (=?iso-8859-1?Q?Micha=EBl?= Cadilhac) Newsgroups: gmane.emacs.devel Subject: flyspell: check repeated words in another way. Date: Thu, 30 Aug 2007 17:44:17 +0200 Organization: Epita/LRDE Message-ID: <87ir6xm3hq.fsf@cadilhac.name> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0990168301==" X-Trace: sea.gmane.org 1188488547 25049 80.91.229.12 (30 Aug 2007 15:42:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 30 Aug 2007 15:42:27 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 30 17:42:25 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IQmA2-0007DK-2G for ged-emacs-devel@m.gmane.org; Thu, 30 Aug 2007 17:42:22 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IQmA1-0005oZ-OL for ged-emacs-devel@m.gmane.org; Thu, 30 Aug 2007 11:42:21 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IQm9x-0005nr-MM for emacs-devel@gnu.org; Thu, 30 Aug 2007 11:42:17 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IQm9w-0005nS-6h for emacs-devel@gnu.org; Thu, 30 Aug 2007 11:42:17 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IQm9w-0005nP-1Y for emacs-devel@gnu.org; Thu, 30 Aug 2007 11:42:16 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IQm9v-0002SX-DE for emacs-devel@gnu.org; Thu, 30 Aug 2007 11:42:15 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IQm9o-0002C7-B6 for emacs-devel@gnu.org; Thu, 30 Aug 2007 17:42:08 +0200 Original-Received: from pc4-154.lri.fr ([129.175.4.154]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 30 Aug 2007 17:42:08 +0200 Original-Received: from michael by pc4-154.lri.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 30 Aug 2007 17:42:08 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 109 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: pc4-154.lri.fr X-Website: http://michael.cadilhac.name Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEVWPh+Tai+5r5YKBAEU CQQzGAtiq7gjAAACR0lEQVQ4jW2UzW7lIAyFzVW8BzTZX5DmCZLuU2H2pMXv/ypzbK7aSh2kRCRf /HNsE0q7Sg+RQ7JFKaqtrRNAl5AIIKe6D5DBqgbmUAe5hBI1wIRFAHjeM0RKtZi7XVVEpb0BSNfA IddChChT5DildSLWOWhY5IEItMnncZgFcUAc/5jjwCMsDosRNdfKPDTFEdVBW8C+RebDb4N5Orio RhM1+11IJyx0ng2+LryFHBMPDQDYHrY6IfGuU3ouiXTQNE8LIJDKOWpNxERTFrggQwRPd7USUsTW fJ0XbR3bdj5KgBYy4SACpxDeUYEUAzLmtJ1iIrD2gczPq8Qomjhsh/RjGIgKIO8p7NITjwlx7WID nsnQe5NeuTvoBpi8LX6vLLOh5icjOHqBypgnuSp7M+RE1agbQKHQr5E2z1WObhYW4gMqeGQL7joM jCf2DxSk5ApADSYHfFF4igNfJZL1z0GKP0FN02s4XiDXr7V5P94W6I9v8MfBOQDmfwAaVYt+x8Da v4DJvX8BAdin3Knm5yMZYAO4ABDkDniZLLfi4P40gP1F0TPGZOu0CGwA1lcowxwlGy6A9705mD0V jHCxwVZT/hYdRJVUGZNlx6l7ScQBTluof6Wj6bsPYlvpwoTvXFD9gHPn2TZPF3ntI2ecxVrW5MrV XiCie5EeNa7BlWu/HNSkprDUva163PHxAv5jyGV7gVzyAghSKOTnat85UIYFICXbD2NV9rRiv0BS tKQsg6OHH4A15F1WW+UHKHHa32h6aPnAm3/pUcWp+WYnTQAAAABJRU5ErkJggg== User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.50 (gnu/linux) Cancel-Lock: sha1:IHnP3CwsCnjDrPJrSOG7msdkVPU= X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) 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:77423 Archived-At: --===============0990168301== Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi folk! You all know how French is a beautiful language, constructed with poetry in mind, and has been for many years one of the thing the French are proudest about. However, such beautifulness doesn't come without a price. For instance, when we write =AB we love each other =BB, we say =AB nous nous aimons =BB. = If you have a close look, you'll see there's a repeated =AB nous =BB, and this is normal. Another example would be =AB vous vous battez =BB, with a doubled =AB vous =BB. Those are the only exceptions I can think of, but anyway, the problem is that flyspell flags them as errors. Maybe the following could be installed, and if it's too specific, it could be useful for someone. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=flyspell.patch Content-Transfer-Encoding: quoted-printable Index: flyspell.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/emacs/emacs/lisp/textmodes/flyspell.el,v retrieving revision 1.122 diff -b -u -w -r1.122 flyspell.el =2D-- flyspell.el 13 Aug 2007 13:40:48 -0000 1.122 +++ flyspell.el 30 Aug 2007 15:33:39 -0000 @@ -66,12 +66,22 @@ :type 'boolean) =20 (defcustom flyspell-mark-duplications-flag t =2D "Non-nil means Flyspell reports a repeated word as an error. + "Non-nil means Flyspell treats repeated words as errors. +See `flyspell-mark-duplications-exceptions' to add exceptions to this rule. Detection of repeated words is not implemented in \"large\" regions; see `flyspell-large-region'." :group 'flyspell :type 'boolean) =20 +(defcustom flyspell-mark-duplications-exceptions + '(("francais" . ("nous" "vous"))) + "A list of exception for duplicated words. +It should be a list of (LANGUAGE . EXCEPTION-LIST). LANGUAGE is matched +against the current dictionary and EXCEPTION-LIST is a list of strings. +The duplicated word is downcased before it is compared with the exceptions= ." + :group 'flyspell + :type '(alist :key-type string :value-type (repeat string))) + (defcustom flyspell-sort-corrections nil "Non-nil means, sort the corrections alphabetically before popping them." :group 'flyspell @@ -1022,6 +1032,13 @@ (and (> start (point-min)) (not (memq (char-after (1- start)) '(?\} ?\\))))) flyspell-mark-duplications-flag + (not (catch 'exception + (dolist (except flyspell-mark-duplications-exceptions) + (and (string=3D (or ispell-local-dictionary + ispell-dictionary) + (car except)) + (member (downcase word) (cdr except)) + (throw 'exception t))))) (save-excursion (goto-char start) (let* ((bound --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable So long! =2D-=20 | Micha=EBl `Micha' Cadilhac | 21 seems like a good value: half o= f | | http://michael.cadilhac.name | of 42 and just old enough to drink! = | | JID/MSN: | Why would you want to change it? = | `---- michael.cadilhac@gmail.com | -- Stefan Monnier - = --' --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.6 (GNU/Linux) iD8DBQFG1uXUUJhDmOfFA3URAqhqAJ9qNUkpNis0YRwH+POP8pjiRf8J7wCeNedn rXWwLoyZHxdKg2i2o1ZiFj0= =L8e7 -----END PGP SIGNATURE----- --==-=-=-- --===============0990168301== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --===============0990168301==--