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: Excessive refontification when setting jit-lock-context-unfontify-pos Date: Sun, 29 Apr 2007 20:23:22 -0400 Message-ID: References: <87bqhdaajz.fsf@neutrino.caeruleus.net> <877is1wjti.fsf@neutrino.caeruleus.net> <87ps5tufmf.fsf@neutrino.caeruleus.net> <87k5vxvh4x.fsf@neutrino.caeruleus.net> <87r6q48qo5.fsf@neutrino.caeruleus.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1177892615 18650 80.91.229.12 (30 Apr 2007 00:23:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 30 Apr 2007 00:23:35 +0000 (UTC) Cc: emacs-devel@gnu.org To: Ralf Angeli Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 30 02:23:33 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HiJft-000220-P9 for ged-emacs-devel@m.gmane.org; Mon, 30 Apr 2007 02:23:30 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HiJm1-0004Tb-Al for ged-emacs-devel@m.gmane.org; Sun, 29 Apr 2007 20:29:49 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HiJlx-0004P0-8w for emacs-devel@gnu.org; Sun, 29 Apr 2007 20:29:45 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HiJlw-0004On-6N for emacs-devel@gnu.org; Sun, 29 Apr 2007 20:29:44 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HiJlw-0004Ok-2g for emacs-devel@gnu.org; Sun, 29 Apr 2007 20:29:44 -0400 Original-Received: from tomts10.bellnexxia.net ([209.226.175.54] helo=tomts10-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HiJfn-0001XJ-E2 for emacs-devel@gnu.org; Sun, 29 Apr 2007 20:23:23 -0400 Original-Received: from pastel.home ([70.55.145.115]) by tomts10-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20070430002322.HSYO1723.tomts10-srv.bellnexxia.net@pastel.home> for ; Sun, 29 Apr 2007 20:23:22 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 115F48074; Sun, 29 Apr 2007 20:23:22 -0400 (EDT) In-Reply-To: <87r6q48qo5.fsf@neutrino.caeruleus.net> (Ralf Angeli's message of "Sat\, 28 Apr 2007 17\:27\:54 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.97 (gnu/linux) X-detected-kernel: Solaris 8 (1) 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:70383 Archived-At: >> (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.