From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: jit-lock simplification? Date: Wed, 13 Sep 2006 09:03:31 -0400 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1158152725 2267 80.91.229.2 (13 Sep 2006 13:05:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 13 Sep 2006 13:05:25 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 13 15:05:14 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GNUQ0-0006pI-DR for ged-emacs-devel@m.gmane.org; Wed, 13 Sep 2006 15:04:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GNUPz-000526-Si for ged-emacs-devel@m.gmane.org; Wed, 13 Sep 2006 09:04:43 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GNUOt-0004eH-DS for emacs-devel@gnu.org; Wed, 13 Sep 2006 09:03:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GNUOr-0004dS-GN for emacs-devel@gnu.org; Wed, 13 Sep 2006 09:03:34 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GNUOr-0004dJ-3a for emacs-devel@gnu.org; Wed, 13 Sep 2006 09:03:33 -0400 Original-Received: from [209.226.175.97] (helo=tomts40-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GNUQZ-0006rw-N6 for emacs-devel@gnu.org; Wed, 13 Sep 2006 09:05:19 -0400 Original-Received: from localhost ([70.55.143.90]) by tomts40-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20060913130331.OVDX24981.tomts40-srv.bellnexxia.net@localhost>; Wed, 13 Sep 2006 09:03:31 -0400 Original-Received: by localhost (Postfix, from userid 20848) id 990DD9022; Wed, 13 Sep 2006 09:03:31 -0400 (EDT) Original-To: storm@cua.dk (Kim F. Storm) In-Reply-To: (Kim F. Storm's message of "Wed\, 13 Sep 2006 14\:25\:00 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:59767 Archived-At: > I was debugging a timer problem, and noticed some very odd lambda > forms in the timer-list. It turns out to be the lambda generated by > the jit-lock code below. > Wouldn't it work just as well with the following patch? I see no reason why it shouldn't work as well. I just find it less elegant ;-) Stefan > *** jit-lock.el 25 Aug 2006 08:57:52 +0200 1.55 > --- jit-lock.el 13 Sep 2006 14:12:18 +0200 > *************** > *** 397,415 **** > ;; eagerly extend the refontified region with > ;; jit-lock-after-change-extend-region-functions. > (when (< start orig-start) > ! (lexical-let ((start start) > ! (orig-start orig-start) > ! (buf (current-buffer))) > ! (run-with-timer > ! 0 nil (lambda () > ! (with-current-buffer buf > ! (with-buffer-prepared-for-jit-lock > ! (put-text-property start orig-start > ! 'fontified t))))))) > ;; Find the start of the next chunk, if any. > (setq start (text-property-any next end 'fontified nil)))))))) > > ;;; Stealth fontification. > --- 397,415 ---- > ;; eagerly extend the refontified region with > ;; jit-lock-after-change-extend-region-functions. > (when (< start orig-start) > ! (run-with-timer 0 nil 'jit-lock-fontify-again > ! (current-buffer) start orig-start)) > ;; Find the start of the next chunk, if any. > (setq start (text-property-any next end 'fontified nil)))))))) > + (defun jit-lock-fontify-again (buf start end) > + "Fontify in buffer BUF from START to END." > + (with-current-buffer buf > + (with-buffer-prepared-for-jit-lock > + (put-text-property start end 'fontified t)))) > + > + > > ;;; Stealth fontification. > -- > Kim F. Storm http://www.cua.dk > _______________________________________________ > Emacs-devel mailing list > Emacs-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-devel