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: Stefan Monnier
Subject: Re: Excessive refontification when setting jit-lock-context-unfontify-pos
Date: Sun, 29 Apr 2007 20:23:22 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.97 (gnu/linux)

>> (run-with-timer 0 nil 'jit-lock-force-redisplay
>> (current-buffer) start orig-start))
>> 
>> So in your case you can either use
>> jit-lock-after-change-extend-region-functions; 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.

> By the way, `jit-lock-force-redisplay' uses the macro
> `with-buffer-prepared-for-jit-lock' which is only defined when
> jit-lock.el is being compiled.  Is there a way to use that macro from
> outside of jit-lock.el?  A `(require 'jit-lock)' does not help.

It'd probably be better to not bother with the "feature" of only
defining that macro when compiling.  But in the mean time (and to work with
older Emacsen), you may want to (eval-when-compile (load "jit-lock.el")).
Yuck :-(


        Stefan


PS: Of course you can also use your own copy of the macro.




reply via email to

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