Discussion:
Bug in syntax highlighting
Dennis W
2005-03-26 11:46:56 UTC
Permalink
Hi folks,

the following tex file causes problems with AUCTeX when syntax highlighting is
turned on:

===begin file
\[
\label{gurke}

[peter]
\]
===end file

actually, this file alone works well, but if I now enter \end or \begin right
below the line containing \label, xemacs hangs as soon as the final letter "d"
resp. "n" is typed in. Typing C-c on the command line where xemacs was invoked
brings it back to life.

Does anyone know about this problem or how to solve it?

Thanks a lot

Dennis



Emacs : XEmacs 21.4 (patch 15) "Security Through Obscurity" [Lucid] (i686-pc-linux, Mule) of Mon Nov 29 2004 on mathilda
Package: AUCTeX CVS-1.13 (2005-02-11)

current state:
==============
(setq
window-system 'x
LaTeX-version "2e"
TeX-style-path '("style/" "auto/" "/home/dw/.TeX/style/" "/usr/share/doc/.TeX/style/"
"/usr/doc/.TeX/style/" "/home/dw/.TeX/auto/" "/usr/share/doc/.TeX/auto/"
"/usr/doc/.TeX/auto/" "/usr/local/lib/xemacs/xemacs-packages/etc/auctex/style/"
"/usr/local/lib/xemacs/xemacs-packages/etc/auctex/auto/")
TeX-auto-save t
TeX-parse-self t
TeX-master nil
)
Ralf Angeli
2005-03-26 18:09:44 UTC
Permalink
Post by Dennis W
the following tex file causes problems with AUCTeX when syntax
===begin file
\[
\label{gurke}
[peter]
\]
===end file
actually, this file alone works well, but if I now enter \end or
\begin right below the line containing \label, xemacs hangs as soon
as the final letter "d" resp. "n" is typed in.
You don't even need the math environment. Something like

\begi
[foo]

and typing the "n" of \begin suffices.

AFAICS this is an infinite loop triggered by point not advancing
inside of the function `font-latex-match-command-with-arguments'. I
already have a way to prevent the infloop from appearing but have to
check if it is the right way to fix it.
Post by Dennis W
Typing C-c on the
command line where xemacs was invoked brings it back to life.
Why don't you just type `C-g'?
--
Ralf
Ralf Angeli
2005-03-27 10:35:37 UTC
Permalink
Post by Ralf Angeli
AFAICS this is an infinite loop triggered by point not advancing
inside of the function `font-latex-match-command-with-arguments'. I
already have a way to prevent the infloop from appearing but have to
check if it is the right way to fix it.
It should be fixed in CVS now. Thanks for the report.

A note for developers: `font-latex-match-command-with-arguments'
currently can fontify partial matches of such commands. That means,
suppose the macro \foo expects a mandatory argument and you only have
"\foo" in the buffer, it will get fontified. What I'd like it to do
is to fontify it only if the mandatory argument is actually present,
that means if there is "\foo{bar}" in the buffer. I attached a patch
to this message which shows how this could be done. The problem with
it is that it breaks some things which rely on the function being able
to fontify partial matches. For example \item won't get fontified
anymore. Fixing this correctly, would require information about the
arguments a command accepts. You know, that "[{{" thingy mentioned
before. Once we have that, the attached patch might become
interesting again.
--
Ralf
Loading...