unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Joe Wells <jbw@macs.hw.ac.uk>
To: Glenn Morris <rgm@gnu.org>
Cc: bug-gnu-emacs@gnu.org
Subject: Re: tex-validate-region reports false errors on some LaTeX commands
Date: Fri, 21 Sep 2007 13:06:11 +0100	[thread overview]
Message-ID: <86r6ks8bpo.fsf@macs.hw.ac.uk> (raw)
In-Reply-To: <5dvea4r9xv.fsf@fencepost.gnu.org> (Glenn Morris's message of "Thu\, 20 Sep 2007 23\:09\:32 -0400")

Glenn Morris <rgm@gnu.org> 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




      reply	other threads:[~2007-09-21 12:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <861wd8trf5.fsf@macs.hw.ac.uk>
2007-09-09  8:37 ` tex-validate-region reports false errors on some LaTeX commands martin rudalics
2007-09-09 10:39   ` Joe Wells
2007-09-21  3:09     ` Glenn Morris
2007-09-21 12:06       ` Joe Wells [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86r6ks8bpo.fsf@macs.hw.ac.uk \
    --to=jbw@macs.hw.ac.uk \
    --cc=bug-gnu-emacs@gnu.org \
    --cc=rgm@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).