[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: jit-lock refontifies too much
From: |
martin rudalics |
Subject: |
Re: jit-lock refontifies too much |
Date: |
Wed, 14 Sep 2005 07:48:57 +0200 |
User-agent: |
Mozilla Thunderbird 1.0 (Windows/20041206) |
>> (when font-lock-multiline
>> (setq end (or (text-property-any end (point-max)
>> 'font-lock-multiline nil)
>> (point-max)))
>> (goto-char end)
>> (setq end (line-beginning-position 2)))
>> ;; Now do the fontification.
>
>
> I'd rather change jit-lock, since font-lock may be used without jit-lock.
It would be unsafe to change jit-lock. Currently it is not mandatory
for a "font-lock-fontify-region-function" to adjust the end of the
region. delphi-fontify-region, for example, doesn't. It does rely on
jit-lock-fontify-now to provide correct endpoints. Put this the other
way round. If font-lock-default-fontify-region's present approach to
fontify an additional line were indeed mandatory, most current
font-lock-fontify-region-functions would be invalid since they do not
adjust the end of the region.
Anyway, my first solution should emulate your proposal. It would
suppress fontification of the second line iff jit-lock is turned on.
Using font-lock without jit-lock would not change the current behavior:
(cond
(font-lock-multiline
(setq end (or (text-property-any end (point-max)
'font-lock-multiline nil)
(point-max)))
(goto-char end) (setq end (line-beginning-position 2)))
;; don't modify end in jit-lock-mode
((and (boundp 'jit-lock-mode) jit-lock-mode))
(t (goto-char end) (setq end (line-beginning-position 2))))
;; Now do the fontification.
- jit-lock refontifies too much, martin rudalics, 2005/09/12
- Re: jit-lock refontifies too much, Stefan Monnier, 2005/09/12
- Re: jit-lock refontifies too much,
martin rudalics <=
- Re: jit-lock refontifies too much, Stefan Monnier, 2005/09/14
- Re: jit-lock refontifies too much, martin rudalics, 2005/09/15
- Re: jit-lock refontifies too much, Richard M. Stallman, 2005/09/19
- Re: jit-lock refontifies too much, Stefan Monnier, 2005/09/20
- Re: jit-lock refontifies too much, martin rudalics, 2005/09/21
- Re: jit-lock refontifies too much, Stefan Monnier, 2005/09/21
- Re: jit-lock refontifies too much, martin rudalics, 2005/09/22
- Re: jit-lock refontifies too much, Stefan Monnier, 2005/09/22
- Re: jit-lock refontifies too much, martin rudalics, 2005/09/25
- Re: jit-lock refontifies too much, Richard M. Stallman, 2005/09/26