From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Piet van Oostrum Newsgroups: gmane.emacs.devel Subject: Re: flyspell bug Date: Sun, 30 Oct 2005 14:25:01 +0100 Message-ID: References: <20051025005824.089B.SLAWOMIR.NOWACZYK.847@student.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7BIT X-Trace: sea.gmane.org 1130680033 19793 80.91.229.2 (30 Oct 2005 13:47:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 30 Oct 2005 13:47:13 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 30 14:47:09 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EWDUz-0005n4-Op for ged-emacs-devel@m.gmane.org; Sun, 30 Oct 2005 14:45:26 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EWDTN-0001x5-Da for ged-emacs-devel@m.gmane.org; Sun, 30 Oct 2005 08:43:45 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EWDE4-00020L-0V for emacs-devel@gnu.org; Sun, 30 Oct 2005 08:27:56 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EWDDw-0001s9-FA for emacs-devel@gnu.org; Sun, 30 Oct 2005 08:27:49 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EWDCK-0000ug-S7 for emacs-devel@gnu.org; Sun, 30 Oct 2005 08:26:09 -0500 Original-Received: from [195.121.247.7] (helo=smtp16.wxs.nl) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EWDCK-0002y0-79 for emacs-devel@gnu.org; Sun, 30 Oct 2005 08:26:08 -0500 Original-Received: from ordesa.cs.uu.nl (ip54573050.direct-adsl.nl [84.87.48.80]) by smtp16.wxs.nl (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTP id <0IP600FAODBGNW@smtp16.wxs.nl> for emacs-devel@gnu.org; Sun, 30 Oct 2005 14:26:04 +0100 (CET) Original-Received: by ordesa.cs.uu.nl (Postfix, from userid -2) id 25F4425119E; Sun, 30 Oct 2005 14:25:03 +0100 (CET) Original-Received: from ordesa.local (localhost [127.0.0.1]) by ordesa.cs.uu.nl (Postfix) with ESMTP id 526AE25116D for ; Sun, 30 Oct 2005 14:25:03 +0100 (CET) In-reply-to: Original-To: emacs-devel@gnu.org X-Mailer: emacs 22.0.50.1 (via feedmail 8 I) User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) 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:45134 Archived-At: >>>>> "Richard M. Stallman" (RMS) wrote: >RMS> It is not obvious to me how to do that. Could you send the patch that >RMS> you are proposing? ,---- | --- /Users/piet/Projects/cvs/emacs/lisp/textmodes/ispell.el.~1~ 2005-10-24 09:17:22.000000000 +0200 | +++ /Users/piet/Projects/cvs/emacs/lisp/textmodes/ispell.el 2005-10-30 09:35:28.000000000 +0100 | @@ -579,7 +579,7 @@ | ("francais" ; Francais.aff | "[A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374]" | "[^A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374]" | - "[-']" t nil "~list" iso-8859-1) | + "[-'.@]" t nil "~list" iso-8859-1) | ("francais-tex" ; Francais.aff | "[A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374\\]" | "[^A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374\\]" `---- >RMS> One possible problem occurs to me: would adding . to this >RMS> cause incorrect behavior at the end of nearly every sentence? No. The `boundarychars' are only accepted between letters of the word, not at the ends. >RMS> Meanwhile, does this patch fix the problem? It tries to detect >RMS> such cases, and recognize that the word has been found but can't >RMS> really be checked. >RMS> *** flyspell.el 25 Oct 2005 09:08:25 -0400 1.81 >RMS> --- flyspell.el 29 Oct 2005 12:06:29 -0400 >RMS> *************** >RMS> *** 1356,1362 **** >RMS> (progn >RMS> (setq flyspell-large-region-beg (point)) >RMS> (goto-char (- (point) 1)) >RMS> ! (setq keep (flyspell-word))) >RMS> (error "Bug: misspelled word `%s' (output pos %d) not found in buffer" >RMS> word wordpos))))))) >RMS> ;; we are done >RMS> --- 1356,1365 ---- >RMS> (progn >RMS> (setq flyspell-large-region-beg (point)) >RMS> (goto-char (- (point) 1)) >RMS> ! (if (< (length (flyspell-get-word following)) That should be: (if (< (length (car (flyspell-get-word nil))) flyspell-word returns a triple (word startpos endpos) >RMS> ! (length word)) >RMS> ! (setq keep nil) >RMS> ! (setq keep (flyspell-word)))) >RMS> (error "Bug: misspelled word `%s' (output pos %d) not found in buffer" >RMS> word wordpos))))))) >RMS> ;; we are done You can also factor out the "setq keep": (setq keep (if (< (length (car (flyspell-get-word nil))) (length word)) nil (flyspell-word)))) It solves the problem at hand. I can't think of any bad effects this would have otherwise than missing some misspellings with a "." or "@" in it. I wouldn't care much for the "@" because I think it shouldn't be there. Anyhow, the ispell-dictionary-alist should be made compatible with the definitions in the dictionaries. -- Piet van Oostrum URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: piet@vanoostrum.org