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: Fri, 18 Nov 2005 15:54:45 +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=utf-8 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1132332634 1643 80.91.229.2 (18 Nov 2005 16:50:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 18 Nov 2005 16:50:34 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 18 17:50:06 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Ed9Hn-0002q5-Ig for ged-emacs-devel@m.gmane.org; Fri, 18 Nov 2005 17:40:27 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ed9Hn-0006Il-34 for ged-emacs-devel@m.gmane.org; Fri, 18 Nov 2005 11:40:27 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ed8dZ-000086-R6 for emacs-devel@gnu.org; Fri, 18 Nov 2005 10:58:54 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ed8dW-00005t-R7 for emacs-devel@gnu.org; Fri, 18 Nov 2005 10:58:51 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ed8dV-000057-Mi for emacs-devel@gnu.org; Fri, 18 Nov 2005 10:58:49 -0500 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 1Ed8dV-0002dw-LY for emacs-devel@gnu.org; Fri, 18 Nov 2005 10:58:50 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Ed8ad-0004c1-Bk for emacs-devel@gnu.org; Fri, 18 Nov 2005 16:55:51 +0100 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 ; Fri, 18 Nov 2005 16:55:51 +0100 Original-Received: from agustin.martin by Agmartin.aq.upm.es with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 18 Nov 2005 16:55:51 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 66 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.12) Gecko/20050922 Firefox/1.0.7 (Debian package 1.0.7-1)) 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:46228 Archived-At: Piet van Oostrum cs.uu.nl> writes: > > I have found the bug. > > Explanation: ... > > 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"). > > The solution is to give ispell the "-t" option. > > diff -u ~/Projects/cvs/emacs/lisp/textmodes/flyspell.el flyspell.el > --- /Users/piet/Projects/cvs/emacs/lisp/textmodes/flyspell.el 2005-10-24 09:17:22.000000000 +0200 > +++ flyspell.el 2005-10-24 15:38:27.000000000 +0200 > -1389,6 +1389,8 > (if ispell-local-dictionary > (setq ispell-dictionary ispell-local-dictionary)) > (setq args (ispell-get-ispell-args)) > + (if (eq ispell-parser 'tex) > + (setq args (cons "-t" args))) > (if ispell-dictionary ; use specified dictionary > (setq args > (append (list "-d" ispell-dictionary) args))) > This seems to have some side effects with ispell, save --------------------- óptica --------------------- to something.tex, make sure flyspell-large-region limit is set to 1, select castellano8 dictionary and run flyspell-buffer if: Bug: misspelled word `ptica' (output pos 7) not found in buffer and contents of flyspell-region buffer (containing words ispell considers misspelled) is ptica Seems that by doing that, ispell is also setting to the tex charset, e.g. $ echo français | ispell -l -t -d francais fran ais with the word "français" and the francais dict (they could also be used to test this problem) aspell seems to accept that. -- Agustin