emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Excessive refontification when setting jit-lock-context-unfontify-po


From: Ralf Angeli
Subject: Re: Excessive refontification when setting jit-lock-context-unfontify-pos
Date: Fri, 27 Apr 2007 20:02:13 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.96 (gnu/linux)

* martin rudalics (2007-04-25) writes:

>  > In AUCTeX's LaTeX mode ``text in quotes'' will get highlighted.  If I
>  > start a quote, move a page downwards
>
> ... here a function on `window-scroll-functions' should decide what to
> do with such pending quotes - provided you're 100% sure that you cannot
> turn them into strings syntactically spoken ...

IIRC I decided to leave fontification of quoted text to font lock
keywords because like that I can test if the quote is e.g. in a
LaTeX verbatim environment and disregard it in such a case.

>  > and insert the ending quotation
>  > marks, only part of the text in quotes will get the appropriate face
>  > if j-l-c-u-p is not set.
>
> ... a function on `after-change-functions' would have to find the
> matching starting quote and put a multiline property on the entire
> quoted text.

Yes.  I think my first try with `after-change-functions' was to advise
`jit-lock-after-change' and extend the region right there.

> Setting `jit-lock-context-unfontify-pos' doesn't make
> sense here: If moving the page downwards moves the starting quote
> _before_ `window-start' font-lock might not find it in the first place.

The `font-lock-fontify-region-function' calls functions to extend the
region backwards.  So this should not be an issue.  In the example
code I sent before I did not use such extension functions (I assumed
the region starts at the beginning of the buffer instead) but I hope
it makes the concept clearer nevertheless.

-- 
Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]