From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ivan Andrus Newsgroups: gmane.emacs.bugs Subject: bug#14419: 24.3.50; ispell behaves badly with some TeX documents Date: Fri, 17 May 2013 23:21:26 -0600 Message-ID: <273F0CF4-1050-4BEB-A005-5707AF9961BA@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1368854511 13066 80.91.229.3 (18 May 2013 05:21:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 18 May 2013 05:21:51 +0000 (UTC) To: 14419@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat May 18 07:21:50 2013 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 1UdZaY-0008Gb-4p for geb-bug-gnu-emacs@m.gmane.org; Sat, 18 May 2013 07:21:50 +0200 Original-Received: from localhost ([::1]:35241 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UdZaX-0004nF-Mq for geb-bug-gnu-emacs@m.gmane.org; Sat, 18 May 2013 01:21:49 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51757) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UdZaT-0004lk-Q0 for bug-gnu-emacs@gnu.org; Sat, 18 May 2013 01:21:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UdZaR-0000Qn-E0 for bug-gnu-emacs@gnu.org; Sat, 18 May 2013 01:21:45 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33228) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UdZaR-0000Qi-AM for bug-gnu-emacs@gnu.org; Sat, 18 May 2013 01:21:43 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UdZak-00033S-Tq for bug-gnu-emacs@gnu.org; Sat, 18 May 2013 01:22:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ivan Andrus Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 May 2013 05:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 14419 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.136885452111726 (code B ref -1); Sat, 18 May 2013 05:22:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 May 2013 05:22:01 +0000 Original-Received: from localhost ([127.0.0.1]:49818 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UdZai-000332-C4 for submit@debbugs.gnu.org; Sat, 18 May 2013 01:22:01 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40351) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UdZag-00032i-9z for submit@debbugs.gnu.org; Sat, 18 May 2013 01:21:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UdZaG-0000Pj-IL for submit@debbugs.gnu.org; Sat, 18 May 2013 01:21:33 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:44792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UdZaG-0000Pf-EL for submit@debbugs.gnu.org; Sat, 18 May 2013 01:21:32 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UdZaF-0004kn-F2 for bug-gnu-emacs@gnu.org; Sat, 18 May 2013 01:21:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UdZaE-0000PS-DQ for bug-gnu-emacs@gnu.org; Sat, 18 May 2013 01:21:31 -0400 Original-Received: from mail-pb0-x22c.google.com ([2607:f8b0:400e:c01::22c]:64926) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UdZaE-0000PM-6b for bug-gnu-emacs@gnu.org; Sat, 18 May 2013 01:21:30 -0400 Original-Received: by mail-pb0-f44.google.com with SMTP id wz17so3911899pbc.3 for ; Fri, 17 May 2013 22:21:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:content-type:content-transfer-encoding:subject :message-id:date:to:mime-version:x-mailer; bh=xSFywsXzlf6p1O3KS3sWsXGrs7fMviqYkfbFqErk7z4=; b=IZrrFRk48tLFgiFC0lUzADyl/NX2pmjscjHrby3UTaQr3Hcg6bpry6cah7YhMLF0oL +KkqjYOQ5tKLLOSe1SreTnUSibX4JFLCr2darUz7e+SiOF+1HmIO5+l6/aIxViJgxM9Z pnsLsv3w9HdpMsvf8BXVleURYaVqWZaMjFNxBpY5y8thHaP18///hEkE9pPi84QJaiDC KexCY+QIpagcr6uuNPa0WhzbL1zmxWEHk5wM+3E4zN4c5OSuuoyF5skUSrC8JeIWaAPx vF/UGziaf6D1Hgpyauvn/wDVUgS02VNdazQJoOejX0JQoCyxO/N9a1S3ftj98F11/5fy C3Fw== X-Received: by 10.66.232.230 with SMTP id tr6mr53012638pac.83.1368854488576; Fri, 17 May 2013 22:21:28 -0700 (PDT) Original-Received: from [10.0.2.30] (host-69-145-52-115.bln-mt.client.bresnan.net. [69.145.52.115]) by mx.google.com with ESMTPSA id ya4sm14096728pbb.24.2013.05.17.22.21.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 May 2013 22:21:27 -0700 (PDT) X-Mailer: Apple Mail (2.1503) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:74386 Archived-At: ispell can overlook misspellings and (more annoyingly though easier to=20= detect) can start spell checking everything in math mode. 1. emacs -Q 2. Edit the following document in latex-mode (built in or AUCTeX): % \documentclass[12pt,draft,a4paper]{report} \documentclass[12pt,a4paper]{report} \begin{document} Representation theory concerns itself with the cases when $Y$ is the = general linear group $\GL_{n}(k)$, for some field $k$. spelling is basd $badmath$ here \end{document} 3. Run ispell-buffer 4. It asks you to correct the word badmath. This is in math mode and should be skipped. Moreover, it missed basd outside of math mode. 5. Delete the commented documentclass line (or move it after the other) and things work as they are supposed to. I ran ispell-buffer-with-debug and it seems that it skips the region starting with \documentclass and ending with \begin{document}, but since there was a comment before it the first line gets treated as a comment. This is bad in and of itself if that's what's happening. However, because the _ in $\GL_{n}(k)$ matches the final element of `ispell-skip-region-alist' (not sure what the purpose of that is), the first part of the line is a comment. That last part of the line, namely {n}(k)$, for some field $k$. is the first line that the spell checker sees as not a comment and therefore it gets confused about what is math and what isn't. Other cases of skipping in comments can also lead to bad scenarios. For example in the case below no misspellings are found: % \addcontentsline{1}{2} spelling is basd $badmath$ here. Perhaps it could be fixed by a small change to ispell-region to test if the skip region is in a comment and if so, not skip that region since comments can contain all sorts of malformed TeX. I would try this, but I couldn't find a canonical way to test if point is inside a comment. Feel free to point me to one and I'll give it a shot. -Ivan