From: David Abrahams <dave@boost-consulting.com>
Cc: emacs-devel@gnu.org
Subject: Re: Multiline font lock questions
Date: Tue, 21 Nov 2006 15:07:16 -0500 [thread overview]
Message-ID: <87slgczhqj.fsf@pereiro.luannocracy.com> (raw)
In-Reply-To: jwvd57j6yz6.fsf-monnier+gnu.emacs.help@gnu.org
Stefan Monnier <monnier@iro.umontreal.ca> writes:
Stefan, thanks for your reply.
>> What does "Use" mean? I suppose "set it to non-nil," but I had to
>> guess that jit-lock-contextually was a variable; I suggest a doc tweak.
>
> Problem is: in 99% of the cases, it's already set, so there's nothing to do
> really, other than rely on it doing its job. That's why I set "use".
Saying something explicit like
Ensure that jit-lock-contextually is set (as it is by default)
and rely on it doing its job.
would be more useful
>> ...This will only rehighlight the part
>> of the construct that follows the actual change, and will do it
>> after a short delay. This only works if the highlighting of the
>> various parts of your multiline construct never depends on text in
>> subsequent lines. Since `jit-lock-contextually' is activated by
>> default, this can be an attractive solution.
>
>> That clearly wouldn't work for the example I showed above.
>
> Indeed.
>
>> * Place a `jit-lock-defer-multiline' property on the construct.
>> This works only if `jit-lock-contextually' is used, but it can
>> handle the case where highlighting depends on subsequent lines.
>
>> That seems like it could make it work. What's the advantage of using
>> this method?
>
> Over what? `font-lock-multiline'?
Any other methods you mention in this piece of doc.
>> Doesn't slow down typing as much?
>
> Yes: the re-highlighting is delayed a little bit (see
> jit-lock-context-time), so it doesn't happen after every keystroke.
> For small multiline elements, it's not a big change, but for larger ones, it
> can be significant.
>
> Another difference is that it only works if font-lock uses jit-lock.
It would be great if the doc would give me the information I need in
order to make an informed choice about which method to use.
>> This very page links to another page describing
>> font-lock-extend-after-change-region-function, which seems like it
>> constitutes a fourth way to "do rehighlighting of multiline
>> constructs."
>
> Indeed. Alan McKenzie likes this, but I would rather discourage its
> use.
Why does he like it, and why do you dislike it?
Can we make the doc consistent, please? If there are really four ways
documented, there shouldn't be a page saying there are three ways.
You can always add disparaging words about the fourth way if you
like. As it stands it's hard to tell whether the information even
makes sense.
Thanks,
--
Dave Abrahams
Boost Consulting
www.boost-consulting.com
next prev parent reply other threads:[~2006-11-21 20:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.748.1163772550.2155.help-gnu-emacs@gnu.org>
2006-11-17 17:02 ` Multiline font lock questions rgb
2006-11-17 18:26 ` David Abrahams
[not found] ` <mailman.758.1163787985.2155.help-gnu-emacs@gnu.org>
2006-11-17 20:15 ` rgb
2006-11-17 22:44 ` David Abrahams
2006-11-19 19:21 ` Stefan Monnier
2006-11-21 20:07 ` David Abrahams [this message]
2006-11-21 20:35 ` Stefan Monnier
2006-11-17 14:08 David Abrahams
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=87slgczhqj.fsf@pereiro.luannocracy.com \
--to=dave@boost-consulting.com \
--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 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.