help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: What is the _essential_ difference between lazy-lock and jit-lock?


From: Stefan Monnier
Subject: Re: What is the _essential_ difference between lazy-lock and jit-lock?
Date: Thu, 22 Jan 2004 18:57:08 GMT
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

> Why jit-lock?

Lazy-lock was a neat idea to only do fontification on-the-fly: why fontify
1MB of code before displaying the first 40 lines ?

But it was difficult from elisp to do it right: the hooks available to
lazy-lock to detect when the displayed part of the screen changes and which
parts of the buffer are currently displayed are not very satisfactory:
difficult to use (leading to corner cases where fontification is not done
when it should) and inefficient (lazy-lock is triggered much more often than
necessary).  This is even more true on XEmacs and old Emacs where one of the
hooks used by lazy-lock is (or at least was) missing.

jit-lock grew out of this: create one new hook designed specifically for
this job.  It's simpler, more reliable, faster.

The only tradeoff I know of (other than the fact that some of the features
of lazy-lock have not been ported yet to jit-lock) is that lazy-lock has
some more knowledge about the intention behind a movement because it can
tell whether it's been called via window-scroll-functions or via
buffer-switching, ...

lazy-lock should be declared obsolete.


        Stefan


reply via email to

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