From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: jit-lock doesn't honor font-lock-lines-before
Date: Tue, 30 Aug 2005 22:47:28 -0400 [thread overview]
Message-ID: <87r7cax1w0.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <43144CF6.1070505@gmx.at> (martin rudalics's message of "Tue, 30 Aug 2005 14:11:34 +0200")
>>> The customizable variable `font-lock-lines-before' is not honored by
>>> jit-lock mode.
>>
>> I know what that means in therms of what the code does, but I'm wondering in
>> which circumstance it makes a visible difference to the end user.
>> Do you have a test case?
> Suppose not: Wouldn't that mean `font-lock-lines-before' is useless?
Not at all. font-lock-lines-before has not been introduced to force
refontification of the previous lines but because the N previous lines are
needed as context in order to properly refontify the current line.
Now the code does in fact refontify the previous lines, but it is
a side-effect rather than one of the original goals.
> It's not very difficult to contrive test cases for this. By default
> `font-lock-multiline' is nil. `font-lock-fontify-anchored-keywords'
> won't alter it - the appropriate lines have been commented out. Write
> an arbitrary multiline pattern. Now font-lock won't give it the
> `font-lock-multiline' text property and jit-lock not necessarily reset
> its `fontified' text property after a change. `font-lock-after-change',
> on the other hand, may refontify it provided `font-lock-lines-before' is
> large enough.
Please show me a test case.
> However, I believe that `font-lock-lines-before' is a brute force
> approach to handle such cases and could remarkably slow down editing if
> it were honored by jit-lock mode. Multiline patterns are too delicate
> and should be treated in a completely different way.
Indeed, but nobody has put the work needed to handle them properly.
font-lock-multiline is one hack, font-lock-lines-before is another,
font-lock-fontification-face-function is yet another.
Stefan
next prev parent reply other threads:[~2005-08-31 2:47 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-28 13:08 jit-lock doesn't honor font-lock-lines-before martin rudalics
2005-08-29 8:39 ` Richard M. Stallman
2005-08-30 6:54 ` martin rudalics
2005-08-31 0:23 ` Richard M. Stallman
2005-09-01 6:22 ` martin rudalics
2005-09-01 14:11 ` Stefan Monnier
2005-09-02 5:24 ` martin rudalics
2005-09-02 6:04 ` Richard M. Stallman
2005-09-02 14:30 ` Stefan Monnier
2005-08-31 14:36 ` Richard M. Stallman
2005-08-29 14:13 ` Stefan Monnier
2005-08-30 12:11 ` martin rudalics
2005-08-31 2:47 ` Stefan Monnier [this message]
2005-09-01 6:24 ` martin rudalics
2005-09-01 13:49 ` Stefan Monnier
2005-09-02 6:05 ` Richard M. Stallman
2005-09-02 18:45 ` Stefan Monnier
2005-09-03 9:07 ` Richard M. Stallman
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=87r7cax1w0.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
/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).