[Top][All Lists]

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

Re: [Emacs-diffs] emacs-24 d69e9f1: CC Mode: Stop Font Lock forcing font

From: Stefan Monnier
Subject: Re: [Emacs-diffs] emacs-24 d69e9f1: CC Mode: Stop Font Lock forcing fontification from BOL. Fixes debbugs#19669.
Date: Fri, 20 Mar 2015 14:05:48 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

>> There's your problem: your current setup needs the starting point to be
>> either before "union" or after the first open brace.
>> It breaks down if it's between the two.  That's the problem you need to fix.
> Not really.  CC Mode is quite capable of handling the Font Lock region
> starting at BOL2.

You yourself told me that the region had to start after the brace.

> The problem is, when that starting point needs to be
> after the brace on L2, Font Lock moves the starting point somewhere
> else, fouling up the font locking.

I'm confused: "somewhere else" is typically BOL2.
Here you say this fouls up font-locking, but above you said CC-Mode is
quite capable of handling a font-lock region starting at BOL2.

> One place which is causing me puzzlement is in jit-lock-fontify-now.
> It's this bit:

As you know, jit-lock is irrelevant to those kinds of font-lock problems
(in the sense that it's always possible to trigger the same problems
without the use of jit-lock, tho it may require some time to figure
out a triggering sequence).

> The only way `start' can be before `orig-start' is on the first line of
> the fl region, and start is moved to BOL.  Why is it necessary to go to
> all the expense of using `run-with-timer' rather than just fixing things
> inside `jit-lock-fontify-now'?  What is the use case?

It's explained in the comment.  Which part of the comment don't you understand?
By the time jit-lock is called the redisplay up to orig-start has
already been done (you can assume it's already drawn on the screen).


reply via email to

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