From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Agustin Martin Newsgroups: gmane.emacs.devel Subject: Re: flyspell bug Date: Tue, 25 Oct 2005 13:40:06 +0000 (UTC) Message-ID: 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 1130254423 20632 80.91.229.2 (25 Oct 2005 15:33:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 25 Oct 2005 15:33:43 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 25 17:33:39 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EUQkK-0007qX-S5 for ged-emacs-devel@m.gmane.org; Tue, 25 Oct 2005 17:29:55 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EUQkK-00027O-5g for ged-emacs-devel@m.gmane.org; Tue, 25 Oct 2005 11:29:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EUPiw-0004MH-HE for emacs-devel@gnu.org; Tue, 25 Oct 2005 10:24:22 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EUPis-0004Km-L0 for emacs-devel@gnu.org; Tue, 25 Oct 2005 10:24:21 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EUPis-0004Kh-H6 for emacs-devel@gnu.org; Tue, 25 Oct 2005 10:24:18 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1EUPis-0002LQ-BG for emacs-devel@gnu.org; Tue, 25 Oct 2005 10:24:18 -0400 Original-Received: from root by ciao.gmane.org with local (Exim 4.43) id 1EUPeo-0006nB-F5 for emacs-devel@gnu.org; Tue, 25 Oct 2005 16:20:06 +0200 Original-Received: from Agmartin.aq.upm.es ([138.100.41.131]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 25 Oct 2005 16:20:06 +0200 Original-Received: from agustin.martin by Agmartin.aq.upm.es with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 25 Oct 2005 16:20:06 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 48 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 138.100.41.131 (Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050911 Firefox/1.0.6 (Debian package 1.0.6-5)) 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:44819 Archived-At: Piet van Oostrum cs.uu.nl> writes: > > I have found the bug. > > Explanation: > > flyspell-buffer (actually flyspell-region) works in two different ways, > depending on a small or large region to be checked. For a small region each > word is subjected to flyspell-word. No problem. For a large region > (default > 1000 characters) first the region is piped through ispell which > returns a list of misspelled words. Then each of these words is searched > for in the region (sequentially) and then flyspell-word is applied to it. > This searching and spelling is done in a loop until the misspelling is > found. > > In a TeX file, ispell should be called with the "-t" option and this is not > done. That is the bug. What happens is that ispell finds a misspelled word, > in the refcard.tex for example "newcount". The searching loop finds > "newcount", applies flyspell-word, but flyspell-word accepts the word > because it is in a TeX command. Therefore the loop continues until a really > misspelled "newcount" is found. In this case there is none, so the loop > stops after the second "\newcount". This looping is necessary, because (1) > there could really be a word "newcount" without the backslash, (2) the word > could be found as a substring of a correctly spelled word (e.g. when > "redist" would appear after "redistribute"). Not sure if this will also affect, but pointing out about it, so people is aware When a file not explicitely tex, but containing tex commands is passed to ispell, ispell's default deformatter is nroff, so the beginning of some of the tex commands might be considered as nroff control sequences. That will happen for things starting by \sp and other ones. For instance $ cat test.txt \special \spanish $ cat test.txt | ispell -l -d american ecial anish I do not know if this might affect the scanning mechanism for files containing tex commands (e.g., an sgml document about something tex-related), but since flyspell-large-region calls ispell without -t it might be. http://bugs.debian.org/310844