all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ralf Angeli <angeli@caeruleus.net>
To: martin rudalics <rudalics@gmx.at>
Cc: emacs-devel@gnu.org
Subject: Re: Excessive refontification when setting	jit-lock-context-unfontify-pos
Date: Tue, 24 Apr 2007 20:16:15 +0200	[thread overview]
Message-ID: <87hcr5ab9s.fsf@neutrino.caeruleus.net> (raw)
In-Reply-To: <462DC0D1.8070304@gmx.at> (martin rudalics's message of "Tue\, 24 Apr 2007 10\:33\:21 +0200")

* martin rudalics (2007-04-24) writes:

>  > 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.
>
> Everything's correct.  Scrolling will move you into some text marked as
> not fontified and will trigger fontification from there which will, due
> to your setting, eventually mark the text as not fontified again, which
> will ...

After scrolling through the whole buffer everything obviously is
fontified.  So I am wondering why the function behind
`font-lock-fontify-region-function' is being called even though there
is no need for it.  With the test case this happens when you reach the
buffer end and will eventually stop when scrolling back up.

>  > 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.
>
> It's the desired behavior.  `jit-lock-context-unfontify-pos' should be
> set by jit-lock only.  You are supposed to set this only in extreme
> cases and exercise care to never set this repeatedly.  Why can't you use
> font-lock's new extend-region stuff for this purpose?

Because I need a mechanism which works in Emacs 21 and XEmacs as
well.  I thought about using an after-change function but this does
not help when a chunk of text is being fontified by jit-lock and I
need to look backwards for the start of a multiline construct when no
change happened before.

-- 
Ralf

  reply	other threads:[~2007-04-24 18:16 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87hcr5ab9s.fsf@neutrino.caeruleus.net \
    --to=angeli@caeruleus.net \
    --cc=emacs-devel@gnu.org \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.