[Top][All Lists]

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

Re: Last steps for pretesting (font-lock-extend-region-function)

From: Alan Mackenzie
Subject: Re: Last steps for pretesting (font-lock-extend-region-function)
Date: Wed, 26 Apr 2006 07:44:11 +0000 (GMT)

Hi, Stefan~

On Wed, 26 Apr 2006, Stefan Monnier wrote:

>> Would this not be very inconvenient?  Somebody needing the extend-region
>> functionality in f-l-d-f-r would then have to copy the entire source of
>> the default function, amend the source, make the
>> f-l-fontify-region-funtion buffer local, then set it.

>Of course not, just use a function like

>   (defun c-awk-font-lock-fontify-region (beg end &rest args)
>     (apply 'font-lock-default-fontify-region
>            (c-awk-beginning-of-logical-line beg)
>            (c-awk-end-of-logical-line end)
>            args))

Heh!  Thanks, I should have spotted that myself!

That wouldn't work in the general case, though, because the current
implementation of f-l-d-f-r would foul up the BEG and END parameters
unless they happen to be at line boundaries.  This is another reason for
the refactoring I've been suggesting, to extract a core function from
f-l-d-f-r which fontifies exactly the region it's given.

>-- Stefan


reply via email to

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