[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: jit-lock doesn't honor font-lock-lines-before
From: |
martin rudalics |
Subject: |
Re: jit-lock doesn't honor font-lock-lines-before |
Date: |
Thu, 01 Sep 2005 08:22:46 +0200 |
User-agent: |
Mozilla Thunderbird 1.0 (Windows/20041206) |
> Because this means that every time I insert one character, redisplay
> would refontify `font-lock-lines-before' in addition to the current
> line.
>
> Would that be bad?
It would slow down editing long lines. jit-lock is supposed to make
editing faster.
>
> Whether and when these lines are refontified
> would be _also_ decided by the redisplay engine. And the latter doesn't
> know about `font-lock-lines-before'. For example, editing the first
> line in a window would not "include the line before in refontification".
>
> This is a good point. However, it can probably be fixed by a change in
> the fontification function--when it is called, it should extend the starting
> point for refontification upward by the specified number of lines.
> (This might be the only fix needed.)
>
>
In `font-lock-default-fontify-region', immediately before the comment
;; check to see if we should expand the beg/end area for
;; proper multiline matches
insert either
(setq beg (line-beginning-position (1- font-lock-lines-before)))
or - but this would have to be mentioned in the doc-string of
`font-lock-lines-before' -
(when font-lock-multiline
(setq beg (line-beginning-position (1- font-lock-lines-before))))
remove the corresponding line from `font-lock-after-change-function' and
wait what happens? I'm still sceptical, though ... fontifications would
always overlap by `font-lock-lines-before' lines.
- Re: jit-lock doesn't honor font-lock-lines-before,
martin rudalics <=