[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: address@hidden: Font Lock on-the-fly misfontification in C++]

From: Alan Mackenzie
Subject: Re: address@hidden: Font Lock on-the-fly misfontification in C++]
Date: Mon, 31 Jul 2006 23:04:19 +0100
User-agent: Mutt/1.5.9i

Hi, Stefan!

On Mon, Jul 24, 2006 at 10:35:08AM -0400, Stefan Monnier wrote:

> The patch below seems to fix number 2 and 3 for me.  Someone who
> understands cc-fonts.el better than me and thus knows where the two
> "public XXX" lines are handled could probably do a similar adjustment
> for them.

At the very least, this isn't suitable for the CC Mode repository, since
font-lock-multiline hasn't (yet?) been implemented in XEmacs or older
GNU Emacsen.

I don't know cc-fonts.el that well myself, yet, but I get the feeling
that putting in f-l-multiline properties like this is, at best, only
going to converge gradually on a working solution [to the problem of CC
Mode lines being fontified out of context].  How will we know when every
case has been covered?

As I've said once or twice before, I'd prefer to calculate the f-l
change region explicitly at each change.

>         Stefan
> --- orig/lisp/progmodes/cc-fonts.el
> +++ mod/lisp/progmodes/cc-fonts.el
> @@ -1111,6 +1111,10 @@
>               ;; False alarm.  Return t to go on to the next check.
>               t
> +              (let ((beg (max (1- match-pos) (point-min))))
> +                (if (< beg (line-beginning-position))
> +                    (put-text-property beg (point) 'font-lock-multiline t)))
> +
>             (if (eq decl-or-cast 'cast)
>                 ;; Save the position after the previous cast so we can feed
>                 ;; it to `c-forward-decl-or-cast-1' in the next round.  That


reply via email to

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