[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: Thu, 03 Nov 2005 10:14:45 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>> Setting syntax-begin-function is not enough because currently the
>> font-lock-syntactically-fontified logic does not take advantage of
>> syntax-begin-function.

> To summarize: I believe we agree that font-locking without the "Left
> Margin Convention" would be impractical for C or Lisp.  I'm afraid that
> font-locking without some equivalent convention is impractical for Perl.

I completely agree and have nothing against setting a syntax-begin-function
in Perl mode.  Several major modes set syntax-begin-function to something
that looks at more than just open-paren-in-column-0 and there's nothing
wrong with it.

What I was pointing out is that to make it really useful for perl-mode (and
other modes where we set font-lock-syntactic-keywords), we need to extend
the font-lock-syntactically-fontified logic to take advantage of it.

I.e. currently, if you set a syntax-begin-function in perl-mode you'll get
the following behavior: let's say you haven't fontified anything yet, and
you try to fontify the buffer area 10000-11000 and syntax-begin-function
says that 9000 is a safe spot.  font-lock-fontify-syntactically-region will
be called on 10000-11000 and its call to syntax-ppss will correctly start
working from position 9000.  Good.  But before that font-lock will call
font-lock-fontify-syntactic-keywords-region between 1-11000 (because
font-lock-syntactically-fontified is still 0).  :-(


reply via email to

[Prev in Thread] Current Thread [Next in Thread]