emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#13817: closed (24.3.50; Disabling whitespace-mode


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#13817: closed (24.3.50; Disabling whitespace-mode that was enabled in sgml-mode-hook breaks font-lock)
Date: Tue, 19 Mar 2013 05:11:02 +0000

Your message dated Tue, 19 Mar 2013 09:09:00 +0400
with message-id <address@hidden>
and subject line Re: bug#13817: 24.3.50; Disabling whitespace-mode that was 
enabled in sgml-mode-hook breaks font-lock
has caused the debbugs.gnu.org bug report #13817,
regarding 24.3.50; Disabling whitespace-mode that was enabled in sgml-mode-hook 
breaks font-lock
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
13817: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13817
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 24.3.50; Disabling whitespace-mode that was enabled in sgml-mode-hook breaks font-lock Date: Tue, 26 Feb 2013 10:29:13 +0400
Revno 111881 fixed the obvious problem with whitespace-mode, here's a
less obvious one.

This seems to be localized to sgml-mode and its derivatives so far:
js-mode, ruby-mode, etc are not affected.

1. (add-hook 'sgml-mode-hook 'whitespace-mode)
2. Open a file in sgml-mode or html-mode, or create a buffer and turn
either mode manually. whitespace-mode will be enabled.
3. M-x whitespace-mode => it's disabled, font-lock is gone, the value of
font-lock-keywords is (t nil).

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.

In GNU Emacs 24.3.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.6.0)
 of 2013-02-26 on vbx
Bzr revision: 111882 address@hidden
Windowing system distributor `The X.Org Foundation', version 11.0.11300000
System Description:     Ubuntu 12.10



--- End Message ---
--- Begin Message --- Subject: Re: bug#13817: 24.3.50; Disabling whitespace-mode that was enabled in sgml-mode-hook breaks font-lock Date: Tue, 19 Mar 2013 09:09:00 +0400 User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130307 Thunderbird/17.0.4
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.


--- End Message ---

reply via email to

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