From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: What is the _essential_ difference between lazy-lock and jit-lock? Date: Thu, 22 Jan 2004 18:57:08 GMT Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <9f3pub.9a.ln@acm.acm> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1074798211 11306 80.91.224.253 (22 Jan 2004 19:03:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 22 Jan 2004 19:03:31 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 22 20:03:23 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Ajk6s-0003C3-00 for ; Thu, 22 Jan 2004 20:03:22 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Ajk4G-0007cE-Hx for geh-help-gnu-emacs@m.gmane.org; Thu, 22 Jan 2004 14:00:40 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!snoopy.risq.qc.ca!charlie.risq.qc.ca!53ab2750!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 26 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 Original-NNTP-Posting-Host: 132.204.24.84 Original-X-Complaints-To: abuse@umontreal.ca Original-X-Trace: charlie.risq.qc.ca 1074797828 132.204.24.84 (Thu, 22 Jan 2004 13:57:08 EST) Original-NNTP-Posting-Date: Thu, 22 Jan 2004 13:57:08 EST Original-Xref: shelby.stanford.edu gnu.emacs.help:120332 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:16276 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:16276 > 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