[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: perl mode color highlighting working badly
From: |
Stefan Monnier |
Subject: |
Re: perl mode color highlighting working badly |
Date: |
Mon, 10 Oct 2005 10:45:18 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
> The problem is that in perl-mode some syntax-table text-properties are
> set in font-lock-syntactic-keywords, while others are set in
> font-lock-syntactic-face-function, and that font-lock+jit-lock applies
> font-lock-syntactic-keywords to "all" the buffer but only applies
> font-lock-syntactic-face-function to the displayed part of the buffer.
> Would it be better to apply font-lock-syntactic-face-function
> to "all" the buffer, too?
Already applying font-lock-syntactic-keywords to "all" the buffer defeats
the purpose of jit-lock. Applying font-lock-syntactic-face-function in the
same way would defeat it even more, and this only because perl-mode uses it
in a sneaky way (perl-mode is the only mode which suffers from this
problem).
> (What is the significance of those quotes around "all"?)
font-lock-syntactic-keywords is not really applied eagerly to the whole
buffer, but only to the region between point-min and the currently visible
area. In many cases, this is just as JIT as what happens with the rest of
the font-locking, but if you jump to the end of the buffer right after
opening it, it does indeed end up applying font-lock-syntactic-keywords
eagerly to the whole buffer while font-lock-keywords is only applied to the
last 40 lines. This is done in font-lock-fontify-syntactic-keywords-region
with the following lines:
;; Ensure the beginning of the file is properly syntactic-fontified.
(when (and font-lock-syntactically-fontified
(< font-lock-syntactically-fontified start))
(setq start (max font-lock-syntactically-fontified (point-min)))
(setq font-lock-syntactically-fontified end))
-- Stefan
- Re: perl mode color highlighting working badly, Stefan Monnier, 2005/10/04
- Re: perl mode color highlighting working badly, Richard M. Stallman, 2005/10/10
- Re: perl mode color highlighting working badly,
Stefan Monnier <=
- Re: perl mode color highlighting working badly, Richard M. Stallman, 2005/10/23
- Re: perl mode color highlighting working badly, Stefan Monnier, 2005/10/24
- Re: perl mode color highlighting working badly, Richard M. Stallman, 2005/10/25
- Re: perl mode color highlighting working badly, Stefan Monnier, 2005/10/25
- Re: perl mode color highlighting working badly, Warren L Dodge, 2005/10/25
- Re: perl mode color highlighting working badly, Stefan Monnier, 2005/10/25
- Re: perl mode color highlighting working badly, Warren L Dodge, 2005/10/25
- Re: perl mode color highlighting working badly, Stefan Monnier, 2005/10/25
- Re: perl mode color highlighting working badly, Warren L Dodge, 2005/10/25
- Re: perl mode color highlighting working badly, Stefan Monnier, 2005/10/25