unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Excessive refontification when setting jit-lock-context-unfontify-pos
@ 2007-04-23 19:44 Ralf Angeli
  2007-04-24  8:33 ` martin rudalics
  2007-04-24 14:18 ` Stefan Monnier
  0 siblings, 2 replies; 21+ messages in thread
From: Ralf Angeli @ 2007-04-23 19:44 UTC (permalink / raw)
  To: emacs-devel

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

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2007-04-30  6:33 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-23 19:44 Excessive refontification when setting jit-lock-context-unfontify-pos Ralf Angeli
2007-04-24  8:33 ` martin rudalics
2007-04-24 18:16   ` Ralf Angeli
2007-04-24 20:56     ` martin rudalics
2007-04-24 21:25       ` Ralf Angeli
2007-04-24 14:18 ` Stefan Monnier
2007-04-24 18:31   ` Ralf Angeli
2007-04-24 20:41     ` Stefan Monnier
2007-04-24 21:20       ` Ralf Angeli
2007-04-25  4:22         ` Stefan Monnier
2007-04-25  6:34           ` Ralf Angeli
2007-04-25  7:28             ` Stefan Monnier
2007-04-27 17:53               ` Ralf Angeli
2007-04-27 18:54                 ` Stefan Monnier
2007-04-27 21:11                   ` Ralf Angeli
2007-04-28 15:27                   ` Ralf Angeli
2007-04-30  0:23                     ` Stefan Monnier
2007-04-30  6:33                       ` Ralf Angeli
2007-04-25  8:18             ` martin rudalics
2007-04-27 18:02               ` Ralf Angeli
2007-04-25  8:27             ` martin rudalics

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).