Subject: Re: bug#13817: 24.3.50; Disabling whitespace-mode that was enabled in sgml-mode-hook breaks font-lock
From: Dmitry Gutov <[email-masked]>
To: Stefan Monnier <[email-masked]>
Cc: [email-masked]
Date: Tue, 19 Mar 2013 09:09:00 +0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Version: 24.4

On 18.03.2013 2:30, Stefan Monnier wrote:
>> On the surface, the reason for this is that when whitespace-mode is being
>> turned on in the hook, font-lock-keywords is still nil, and so nil is
>> saved in whitespace-font-lock-keywords.
>
> whitespace.el should probably use font-lock-remove-keywords instead.

That helped, thank you.

I left the disabling/enabling of font-lock-mode there, because otherwise 
the changes in highlighting are not visible until the buffer is modified.