unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* multiline font lock / differences between Emacs 23 and 24
@ 2014-08-18 18:14 David Madore
  2014-08-18 19:38 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: David Madore @ 2014-08-18 18:14 UTC (permalink / raw)
  To: help-gnu-emacs

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!

-- 
     David A. Madore
    (david+news@madore.org,
     http://www.madore.org/~david/ )


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: multiline font lock / differences between Emacs 23 and 24
  2014-08-18 18:14 multiline font lock / differences between Emacs 23 and 24 David Madore
@ 2014-08-18 19:38 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2014-08-18 19:38 UTC (permalink / raw)
  To: help-gnu-emacs

> 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).
[...]
> 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$.

The highlighting rule for $...$ has been changed in Emacs-24 so that it
is recognized less often, to try and avoid the more problematic
false-positives where "the whole buffer" ended up highlighted as math
because the closing $ was hidden in some macro somewhere.

> Is this a regression?

Yes.  Partly done on purpose, tho.  Feel free to file a bug-report,
although offhand, I can't think of a good way fix both cases at the
same time.


        Stefan




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-18 19:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-18 18:14 multiline font lock / differences between Emacs 23 and 24 David Madore
2014-08-18 19:38 ` Stefan Monnier

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).