[Top][All Lists]

[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 23:11:35 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.96 (gnu/linux)

* Stefan Monnier (2007-04-27) writes:

>> When typing `C-l' highlighting appears.  Is there a possibility to
>> enforce such redisplay in an efficient way?  I could probably call
>> `sit-for' somewhere in the code but I am not sure if this would be the
>> right way.
> I understand the problem, then.  Your code is working fine, it's just that
> some part of the text your re-highlight is re-highlighted by jit-lock but
> *after* having been rendered by the redisplay engine.
> Typically it works like this:

Thanks very much for the explanations.

> So in your case you can either use
> jit-lock-after-change-extend-region-functions;

Unfortunately this hook is not available in Emacs 21.

> or you can use a similar
> run-with-timer in your font-lock-fontify-region-function.  If you look at
> jit-lock-force-redisplay, you'll see that it should not cause infinite
> looping because it only causes redisplay (like C-l would) but not
> re-highlighting.

This is probably the way to go.  I tried this and it works very well.
(For Emacs 21 I put the contents of `jit-lock-force-redisplay' into an
anonymous function passed to `run-with-timer'.)

> In Emacs>22 we should fix the font-lock/jit-lock interface so that jit-lock
> can handle this case automatically.

That would be nice, yes.  For now I am relieved that this could be
solved from within AUCTeX as well.

Thank you very much for your valuable help.


reply via email to

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