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

## multiline font lock / differences between Emacs 23 and 24

 From: David Madore Subject: multiline font lock / differences between Emacs 23 and 24 Date: Mon, 18 Aug 2014 20:14:23 +0200 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0

```Dear group,

First, I'm afraid I'm unable to adequately describe my problem because
it seems to be not fully reproducible.  Maybe someone can still get me
on the right track.  The bottom line is that syntax highlight (that is,
font-lock), does not seem to work in the same way for TeX/LaTeX files
under Emacs 24 as under Emacs 23: multiline formulas are often (but not
systematically!) in the wrong color.

I use Emacs's LaTeX mode ("defined in `tex-mode.el'" according to M-x
describe-mode), not AUCTeX (I don't really know what AUCTeX is, in fact,
except that I'm not using it).  I am using Emacs 24 (as provided by
Ubuntu 14.04 LTS under version number 24.3+1-2ubuntu1).

If I write the following sample text fragment in test.tex and then open
it with "emacs -q test.tex":

In fact, if \$X\$ is a topological space and \$D \subseteq X\$ is any
dense subset (not necessarily open), then the regular open algebras of
\$X\$ and \$D\$ coincide.  Indeed, if \$U \subseteq X\$ is open, we have
\$\clos_D (U\cap D) = (\clos_X (U\cap D)) \cap D\$ (this does not use
any assumption on \$U\$ or \$D\$), but \$\clos_D (U\cap D) = \clos_X U\$
because \$D\$ is dense and \$U\$ is open, so \$\clos_D (U\cap D) = (\clos_X
U) \cap D\$.  Now if \$F \subseteq X\$ is closed, we have \$\intr_D(F\cap
D) = D \setminus \clos_D(D\setminus F) = D \setminus
(\clos_X(D\setminus F) \cap D) = (X \setminus \clos_X(D\setminus F))
\cap D = (\intr_X F) \cap D\$.

then the formula spanning the last four lines does not get colored like
all the others.  Strangely enough, if I remove the first two lines of
this paragraph and reformat it with M-q then the same formula now gets
correctly highlighted!  Also, opening the exact same text with Emacs 23
("emacs23 -q test.tex") gives a correct colorization!

I tried running (setq font-lock-multiline t) and re-running
font-lock-fontify-buffer but it doesn't change anything (I don't know
whether it should, I have to admit I don't understand the documentation
at all and I'm doing things more or less at random).

Does someone understand what is going on?  Is this a regression?  Is
there a way I can get the Emacs 23 behavior?

Thanks for any help!

--