From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ralf Angeli Newsgroups: gmane.emacs.devel Subject: Excessive refontification when setting jit-lock-context-unfontify-pos Date: Mon, 23 Apr 2007 21:44:52 +0200 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1177357571 3110 80.91.229.12 (23 Apr 2007 19:46:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 23 Apr 2007 19:46:11 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 23 21:46:05 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 1Hg4Tv-0001YB-2D for ged-emacs-devel@m.gmane.org; Mon, 23 Apr 2007 21:45:51 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hg4ZL-0005W1-Hi for ged-emacs-devel@m.gmane.org; Mon, 23 Apr 2007 15:51:27 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Hg4ZI-0005V8-Qr for emacs-devel@gnu.org; Mon, 23 Apr 2007 15:51:24 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hg4ZH-0005Uh-AA for emacs-devel@gnu.org; Mon, 23 Apr 2007 15:51:24 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hg4ZH-0005Ue-2b for emacs-devel@gnu.org; Mon, 23 Apr 2007 15:51:23 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Hg4Tp-0008Ez-SF for emacs-devel@gnu.org; Mon, 23 Apr 2007 15:45:46 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Hg4TN-0000mj-KK for emacs-devel@gnu.org; Mon, 23 Apr 2007 21:45:17 +0200 Original-Received: from p54a5450c.dip0.t-ipconnect.de ([84.165.69.12]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 23 Apr 2007 21:45:17 +0200 Original-Received: from angeli by p54a5450c.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 23 Apr 2007 21:45:17 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 35 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: p54a5450c.dip0.t-ipconnect.de User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.96 (gnu/linux) Cancel-Lock: sha1:1EcGGFIwxhcRBtgKX5HVKB7Y698= X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:69871 Archived-At: Hi, in AUCTeX I am extending the region to be fontified by `font-lock-default-fontify-region' backwards in order to cater for large multiline constructs. In order to force refontification with jit-lock, `jit-lock-context-unfontify-pos' is set to the start of such a multiline construct. Now when this is done it seems that the affected regions are refontified over and over again. Here is a testcase: (progn (defun my-font-lock-fontify-region (beg end &optional loudly) (setq jit-lock-context-unfontify-pos (- beg 1000)) (message (format "Fontifying ... (buffer: %s, beg: %d)" (prin1-to-string (current-buffer)) beg)) (font-lock-default-fontify-region beg end loudly)) (find-library "lisp-mode") (setq font-lock-fontify-region-function 'my-font-lock-fontify-region)) After executing the form lisp-mode.el should be opened and the `font-lock-fontify-region-function' will be set to the new one defined in the code which always sets `jit-lock-context-unfontify-pos'. If you now scroll to the bottom of the buffer with `C-v' the function obviously gets called a lot. But once the bottom of the buffer is reached I'd expect that to stop unless something changed in the buffer. However, only some activity like scrolling or activating the minibuffer will make the fontification function be called again. This does not happen in Emacs 21, so it looks like this is a regression. I got a bit tangled up in the font-lock and jit-lock code and hope that somebody has an idea of what might be going wrong. -- Ralf