[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: doc for multi-line font-lock
From: |
Stefan Monnier |
Subject: |
Re: doc for multi-line font-lock |
Date: |
28 Oct 2003 11:33:23 -0500 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
> I don't understand that either. However, there's a definite need to
> maintain syntax properties orthogonally to font-lock for other
> purposes not tied to redisplay (as discussed long ago, at least with
> gerd).
100% agreed.
> The specific case I was concerned with was treating
> \end{code}
> ...
> \begin{code}
> as a comment. If the syntax part of that was taken care of separately
> I'd want to be able to fontify arbitrarily long blocks in either
> font-lock-comment-face or in the default face. Would
> font-lock-multiline actually work for that?
No, font-lock-multiline is not a good answer. You can probably get it to
work, but it'll be dog slow if the block becomes really long, and with
things like jit-lock it's difficult to make it work reliably, because
font-lock might highlight the middle of the text without ever seeing
the \end{code}, thus without knowing that there's a multiline thingy here.
But it will work with font-lock-syntactic-face-function (see the handling
of \begin{verbatim}...\end{verbatim} in tex-mode). It still doesn't work
100% because the "contextual refontification" is delayed, but the
highlighting should eventually be correct.
Stefan