GNU bug report logs - #20146
font-lock-extend-jit-lock-region-after-change: results are discarded instead of being returned.

Previous Next

Package: emacs;

Reported by: Alan Mackenzie <acm <at> muc.de>

Date: Thu, 19 Mar 2015 23:03:02 UTC

Severity: normal

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 20146 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 20146 <at> debbugs.gnu.org
Subject: Re: bug#20146: font-lock-extend-jit-lock-region-after-change: results
 are discarded instead of being returned.
Date: Fri, 20 Mar 2015 15:39:10 -0400
> Perhaps we could implement the convention that when a major mode has
> positively set the font-lock region's start and end points, these should
> be accepted by F/J-lock, but when not, F/J-lock should be free to alter
> them (as it typically does now).

No the core of the API is font-lock-fontify-region and it should work
with *any* bounds (i.e. if these need to be extended, it should be done
by font-lock-extend-region-function).

Jit-lock is implemented on top of that API and is hence free to use any
bounds it sees fit.

If you rely on more specific bounds being passed to
font-lock-fontify-region, that means you have a problem on your side.

> The existence of font-lock-extend-after-change-region-function makes
> this distinction possible.

The existence of font-lock-extend-after-change-region-function is an
error on my part (More specifically the result of a weakness on my part:
when you requested this feature, I added
font-lock-extend-region-function (which was the right fix) and
reluctantly accepted to also add
font-lock-extend-after-change-region-function just out of tiredness of
arguing that it was the wrong solution).


        Stefan




This bug report was last modified 5 years and 201 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.