bug-gnu-emacs
[Top][All Lists]

## Re: tex-validate-region reports false errors on some LaTeX commands

 From: Joe Wells Subject: Re: tex-validate-region reports false errors on some LaTeX commands Date: Fri, 21 Sep 2007 13:06:11 +0100 User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Glenn Morris <address@hidden> 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 “(”, then forward-sexp moves to
>> the right of the “)”.  If you put point before the \begin{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, “\begin{xyz}” would need a
syntax-table text property that says it is matched by “\end{xyz}”.
Right now you can only specify single matching characters.

--
Joe