From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joe Wells Newsgroups: gmane.emacs.bugs Subject: Re: tex-validate-region reports false errors on some LaTeX commands Date: Fri, 21 Sep 2007 13:06:11 +0100 Message-ID: <86r6ks8bpo.fsf@macs.hw.ac.uk> References: <861wd8trf5.fsf@macs.hw.ac.uk> <46E3B0B2.2070608@gmx.at> <867in0rul5.fsf@macs.hw.ac.uk> <5dvea4r9xv.fsf@fencepost.gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1190376587 663 80.91.229.12 (21 Sep 2007 12:09:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 21 Sep 2007 12:09:47 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 21 14:09:46 2007 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IYhKM-0002Hb-3C for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Sep 2007 14:09:46 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IYhKJ-0007o3-Td for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Sep 2007 08:09:43 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IYhJu-0007VX-OC for bug-gnu-emacs@gnu.org; Fri, 21 Sep 2007 08:09:18 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IYhJs-0007T8-RG for bug-gnu-emacs@gnu.org; Fri, 21 Sep 2007 08:09:18 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IYhJs-0007Sk-I6 for bug-gnu-emacs@gnu.org; Fri, 21 Sep 2007 08:09:16 -0400 Original-Received: from izanami.macs.hw.ac.uk ([137.195.13.6]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IYhJp-00080t-Bk; Fri, 21 Sep 2007 08:09:13 -0400 Original-Received: from lxultra1.macs.hw.ac.uk ([137.195.27.173]:57621 helo=127.0.0.1) by izanami.macs.hw.ac.uk with smtp (Exim 4.51) id 1IYhJo-0000Ye-2u; Fri, 21 Sep 2007 13:09:12 +0100 Original-Received: (nullmailer pid 688 invoked by uid 1001); Fri, 21 Sep 2007 12:06:11 -0000 In-Reply-To: <5dvea4r9xv.fsf@fencepost.gnu.org> (Glenn Morris's message of "Thu\, 20 Sep 2007 23\:09\:32 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:16587 Archived-At: Glenn Morris writes: > Joe Wells wrote: > >> The correct solution would require that \(, \), \[, and \] are >> treated the same as \begin{math}, \end{math}, \begin{displaymath}, >> and \end{displaymath}. > > I've installed a hack fix along these lines in the trunk. I don't > want to put it in the release branch, since I don't think the > tex-validate-* functions are very important, and the sexp motion > commands seem to be used quite a bit in tex-mode. Okay. I don't understand the distinction between trunk and release branch here, but I assume this must be sensible. >> (\begin{quote}) >> \end{quote} >> >> If you put point to the left of the =E2=80=9C(=E2=80=9D, then forward-se= xp moves to >> the right of the =E2=80=9C)=E2=80=9D. If you put point before the \begi= n{quote}, >> then forward-sexp moves to the right of the \end{quote}. This all >> happens despite the fact that the structures are not balanced >> properly. > > The latex-forward-sexp function is not rigorous. Indeed, it is a fairly gross kludge. It would be nice if font-locking could somehow set up syntax-table text properties to make this work correctly. However, I think the syntax-table text property feature is not sophisticated enough for handling LaTeX. You can only assign syntax-table text properties of the form (SYNTAX-CODE . MATCHING-CHAR). It is probably necessary for LaTeX to be able to do something of the form (SYNTAX-CODE . MATCHING-STRING). For example, =E2=80=9C\begin{xyz}=E2=80=9D would need a syntax-table text property that says it is matched by =E2=80=9C\end{xyz}=E2= =80=9D. Right now you can only specify single matching characters. --=20 Joe