From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Agustin Martin Newsgroups: gmane.emacs.bugs Subject: bug#12768: 24.1; flyspell highlights words which ispell accepts Date: Tue, 6 Nov 2012 18:48:19 +0100 Message-ID: <20121106174819.GA16202@agmartin.aq.upm.es> References: <87zk3414cf.fsf@sc3d.org> <20121031123140.GA17066@agmartin.aq.upm.es> <20121031145318.GA16471@agmartin.aq.upm.es> <24814310.2560.1351781107917.JavaMail.root@mx1-new.spamfiltro.es> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1352224141 9569 80.91.229.3 (6 Nov 2012 17:49:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 6 Nov 2012 17:49:01 +0000 (UTC) To: 12768-done@debbugs.gnu.org, rrt@sc3d.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 06 18:49:10 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TVnGv-0000Y7-PH for geb-bug-gnu-emacs@m.gmane.org; Tue, 06 Nov 2012 18:49:09 +0100 Original-Received: from localhost ([::1]:44472 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVnGm-0003bS-Uw for geb-bug-gnu-emacs@m.gmane.org; Tue, 06 Nov 2012 12:49:00 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:38815) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVnGj-0003as-9j for bug-gnu-emacs@gnu.org; Tue, 06 Nov 2012 12:48:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TVnGd-0000yk-9i for bug-gnu-emacs@gnu.org; Tue, 06 Nov 2012 12:48:57 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42501) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVnGd-0000yg-5n for bug-gnu-emacs@gnu.org; Tue, 06 Nov 2012 12:48:51 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TVnJi-0000pA-SD for bug-gnu-emacs@gnu.org; Tue, 06 Nov 2012 12:52:02 -0500 Resent-From: Agustin Martin Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Tue, 06 Nov 2012 17:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 12768 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 12768@debbugs.gnu.org, agustin.martin@hispalinux.es Original-Received: via spool by 12768-done@debbugs.gnu.org id=D12768.13522242953132 (code D ref 12768); Tue, 06 Nov 2012 17:52:02 +0000 Original-Received: (at 12768-done) by debbugs.gnu.org; 6 Nov 2012 17:51:35 +0000 Original-Received: from localhost ([127.0.0.1]:52752 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TVnJG-0000oT-Uh for submit@debbugs.gnu.org; Tue, 06 Nov 2012 12:51:35 -0500 Original-Received: from edison.ccupm.upm.es ([138.100.198.71]:54655 helo=smtp.upm.es) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TVnJE-0000oL-QQ for 12768-done@debbugs.gnu.org; Tue, 06 Nov 2012 12:51:34 -0500 Original-Received: from agmartin.aq.upm.es (Agmartin.aq.upm.es [138.100.41.131]) by smtp.upm.es (8.14.3/8.14.3/edison-001) with ESMTP id qA6HmJ6w024746; Tue, 6 Nov 2012 18:48:19 +0100 Original-Received: by agmartin.aq.upm.es (Postfix, from userid 1000) id 407E01FE99; Tue, 6 Nov 2012 18:48:19 +0100 (CET) Content-Disposition: inline In-Reply-To: <24814310.2560.1351781107917.JavaMail.root@mx1-new.spamfiltro.es> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:66539 Archived-At: On Thu, Nov 01, 2012 at 04:44:01PM +0200, Eli Zaretskii wrote: > > Date: Thu, 1 Nov 2012 01:10:11 +0100 > > From: Agustin Martin > > Cc: agustin.martin@upm.es > > > > Really strange. With your steps I can even reproduce the problem with > > something as simple as > > > > dnl -- D > > > > If I add something before dnl I still get the problem. > > > > sdfdsfsdnl -- D > > > > IIf I either break the double dash (no double dashes at all) or the > > dnl or remove the "D" after the dashes problem disappear > > > > dfnl -- D > > dnl - - D > > dnl -- > > > > autotest-mode.el is a small file, but II do not see any hint about > > what is happening here. Seems to do something strange with double > > dashes associated with dnl, but I am absolutely clueless, help > > welcome. > > If you step through ispell-region, you will see that it goes bananas > because ispell-skip-region-alist has "--+" as part of it, which > matches the dashes between "dnl" and the text of the comment. What > ispell-region does is remove the dashes, and then _prepend_ "dnl" > (because it's a comment-start string). The result is that we send > something like "^dnl FOO" to the speller, and the character positions > get screwed up, because the characters between "dnl" and "FOO" were > removed. I have been dealing with this a bit more and seems I now I understand things better. (ispell-region) splits regions to spell in lines, and inside lines in portions separated by skip-regions, which are sent to ispell pipe. When inside a comment, the comment string is added as string prefix before sending to the ispell pipe (I guess to make ispell know that the string is part of a comment). However ispell understand this prefix in few modes and of course not in autoconf mode, where `dnl' is spell-checked as any other word (is the only mode I remember now where comment string is an alphabetic string). For other modes the comment string is just ignored by ispell for anything than knowing that string is inside a comment (but properly shifted), and things work with proper shifts. However, for autoconf mode `dnl -- D' dnl is checked first and later is `D' what is sent is `dnl D' (with a dnl prefix), where `dnl' is checked again messing up everything because ispell checks dnl where `D' position is tracked (and expected by ispell.el instead of `dnl'). I have committed a change (r110817) that simply does not prefix the strings when comment-start when in autoconf-mode (ispell does not support that prefix anyway). ispell still does not skip `dnl' as comment header and is shown as a misspelling, but for everything else seems to work. However, please test extensively. > Btw, WIBNI ispell.el had a debug option, which, if set, would collect > in a special buffer everything we send to the speller and its > responses. I find myself adding '(message "sent %s" strin)' > etc. every time I need to debug the communications between ispell.el > and the speller program. WDYT? I have also added a proof of concept for that (r110816), mostly intended to be enabled through dedicated wrapper functions that when called create the debug buffer and enable debugging messages sent through a common function. This is still very preliminary, with only `ispell-buffer-with-debug' using it, but provides some info and as problems get debugged can be extended. Suggestions are welcome, even about a complete re-design if really needed. -- Agustin