[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fontifying outside of region passed to registered JIT lock function
From: |
Stefan Monnier |
Subject: |
Re: Fontifying outside of region passed to registered JIT lock function |
Date: |
Fri, 15 Nov 2013 20:04:47 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
> To explain what I'm doing in simpler terms, suppose you have:
> (a b
> c
> d)
> The close paren is where the indentation would imply, so there's no
> coloring of parens.
> Suppose you edit the code so as it is now:
> (a b
> c
> d)
Right, indeed, jit-lock will probably only refresh the single line that
holds "c". I see two ways to deal with it:
1- do add the face on the text before the beginning of the region.
The problem there, is to make sure this face is kept up-to-date later
on (e.g. removed if you add revert to the previous indentation).
For that you'll want to add a jit-lock-multiline text-property.
2- Change your highlighting scheme so that the face is placed somewhere
inside the region. E.g. highlight the space before "c" instead of
the open paren: highlighting always the parens makes it sound like
you assume the indentation is right, whereas the error may
be in the indentation. So we can highlight either of them.
-- Stefan