From: Ralf Angeli <angeli@caeruleus.net>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: Excessive refontification when setting jit-lock-context-unfontify-pos
Date: Tue, 24 Apr 2007 20:31:44 +0200 [thread overview]
Message-ID: <87bqhdaajz.fsf@neutrino.caeruleus.net> (raw)
In-Reply-To: <jwvbqhdrh8r.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Tue\, 24 Apr 2007 10\:18\:58 -0400")
* Stefan Monnier (2007-04-24) writes:
>> 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.
>
> I presume you don't use the font-lock-extend-region stuff because you need
> it to work with Emacs<22, right?
Yes.
>> In order to force refontification with jit-lock,
>> `jit-lock-context-unfontify-pos' is set to the start of such
>> a multiline construct.
>
> Huh? In which circumstance do you see a need for such a setting?
>
> Hmm...wait... my crystal ball here tells me that you forgot to set the
> font-lock-multiline property from your font-lock-keywords. is that right?
`font-lock-multiline' (the variable) is set to t. And multiline
constructs also get the `font-lock-multiline' property. But I
actually don't want to use `font-lock-multiline' for forward
fontification because it has often led to "color spill". What I am
currently doing is to give up after a certain amount of forward
searching and give the tag probably starting an unfinished multiline
construct a warning color. But that means that the mechanism using
the `font-lock-multiline' property won't find such a property at
boundaries of regions to be fontified. That's why I have to look back
myself for the start of the construct and trigger refontification of
the region.
Anyway, I dug a bit in the archives of emacs-devel and found that I
got the hint about `jit-lock-context-unfontify-pos' from you, but
obviously didn't understand what you told me about its dangers. You
specifically warned about such refontification loops,
cf. <URL:http://mid.gmane.org/jwvirrj7wwg.fsf-monnier+emacs%40gnu.org>.
Now I just need a way to make sure j-l-c-u-p is only set when "when
refontification will indeed make a difference".
> Please read the discussion about multiline and font-lock in the latest Emacs
> manual (it's been significantly improved, so it should help, and if doesn't
> help enough, then we should improve it more).
Will do.
--
Ralf
next prev parent reply other threads:[~2007-04-24 18:31 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
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 [this message]
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bqhdaajz.fsf@neutrino.caeruleus.net \
--to=angeli@caeruleus.net \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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 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).