help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How to fontify region according to mode


From: Lennart Borgman
Subject: Re: How to fontify region according to mode
Date: Mon, 16 Aug 2010 16:39:57 +0200

On Mon, Aug 16, 2010 at 3:28 PM, Dan Davison <davison@stats.ox.ac.uk> wrote:
>>
>> Hi Dan,
>>
>> I am afraid that what you want actually involves the same problem as
>> using multiple major modes. Why don't you think so?
>
> Hi Lennart,
>
> OK, I see. It looks like I was being naive and thinking it was simpler
> than it really is. Seeing as you have worked extensively on this, and as
> I have wasted a little bit of time on it, would you mind explaining to
> me where my above approach encounters problems?  I.e., inside a let
> binding,
>
> 1. bind `font-lock-defaults' to the appropriate value
> 2. bind to nil all the other font-lock related variables that
>   `font-lock-set-defaults' will change
> 3. call `font-lock-set-defaults'
> 4. call `font-lock-fontify-region'


This is essentially the way it is done in mumamo.el, but you have to
do it inside font-lock. Otherwise font-lock will overwrite what you
have done.



reply via email to

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