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: Mon, 24 Oct 2005 19:51:22 +0200 Message-ID: <17245.7962.493659.987445@ordesa.local> References: <20051013122745.23F5.SLAWOMIR.NOWACZYK.847@student.lu.se> <20051014131718.2403.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 1130176481 12009 80.91.229.2 (24 Oct 2005 17:54:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 24 Oct 2005 17:54:41 +0000 (UTC) Cc: Slawomir Nowaczyk , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 24 19:54:33 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EU6U3-0003ut-PB for ged-emacs-devel@m.gmane.org; Mon, 24 Oct 2005 19:51:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EU6U3-0007Dd-0r for ged-emacs-devel@m.gmane.org; Mon, 24 Oct 2005 13:51:43 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EU6Tr-0007Be-1o for emacs-devel@gnu.org; Mon, 24 Oct 2005 13:51:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EU6Tp-00079j-FS for emacs-devel@gnu.org; Mon, 24 Oct 2005 13:51:30 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EU6Tp-00079d-CB for emacs-devel@gnu.org; Mon, 24 Oct 2005 13:51:29 -0400 Original-Received: from [195.121.6.28] (helo=smtp14.wxs.nl) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EU6To-0002WM-PG; Mon, 24 Oct 2005 13:51:28 -0400 Original-Received: from ordesa.cs.uu.nl (ip54573050.direct-adsl.nl [84.87.48.80]) by smtp14.wxs.nl (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTP id <0IOV0051MLLRPT@smtp14.wxs.nl>; Mon, 24 Oct 2005 19:51:27 +0200 (CEST) Original-Received: by ordesa.cs.uu.nl (Postfix, from userid -2) id DC5D424C451; Mon, 24 Oct 2005 19:51:25 +0200 (CEST) Original-Received: from ordesa.local (localhost [127.0.0.1]) by ordesa.cs.uu.nl (Postfix) with ESMTP id 0967924C439; Mon, 24 Oct 2005 19:51:24 +0200 (CEST) In-reply-to: Original-To: rms@gnu.org X-Mailer: emacs 22.0.50.4 (via feedmail 8 I); VM 7.19 under Emacs 22.0.50.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:44750 Archived-At: >>>>> "Richard M. Stallman" (RMS) wrote: >RMS> When I check it, it is considered a misspelling. Maybe it is in your >RMS> personal dictionary? >RMS> That was indeed the reason. Trying it with an empty personal >RMS> dictionary, I observed the bug. This patch seems to work; does it >RMS> give good results? No, not completely. For example in the following (as part of a larger text): % GNU Emacs is free software; you can redistribute it and/or modify % it under the redist terms of the GNU General Public License as published by % the Free Software Foundation; either version 2, or (at your option) % any later version. I inserted the word "redist" in the second line, which is misspelled. However, your code misses this word, because it finds "redistributable" first and that is accepted by flyspell-word. The original code continues and finds "redist" the next time in the inner loop. However, that code can only work correctly when both ispell the program, and ispell.el have the same ideas about TeX commands to skip. I can even imagine that the checking loop goes out of sync with a somewhat more contorted example. Maybe a solution is to change the search-forward into an exact-word search, i.e. change word into a regexp with word-boundary matches. Then it should use the same ideas about words as ispell, and the regexp would slow it down, unfortunately. And now I think of it, are there no problems to be expected with capitalized words where one form is correct and the other (e.g. the lowercase one) is incorrect, with case-fold-search = true? -- Piet van Oostrum URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: piet@vanoostrum.org