GNU bug report logs - #11353
M-x global-whitespace-mode, open file, M-x global-whitespace-mode, doesn't toggle off correctly

Previous Next

Package: emacs;

Reported by: Lars Petter Mostad <larspm <at> gmail.com>

Date: Thu, 26 Apr 2012 16:19:01 UTC

Severity: normal

Tags: fixed

Found in versions 24.3, 24.0.95

Fixed in version 24.4

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


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

From: Jeremy Moore <jmoore <at> ieee.org>
To: 11353 <at> debbugs.gnu.org
Cc: viniciusjl <at> ig.com.br
Subject: Suggested patch to whitespace.el
Date: Thu, 16 May 2013 15:41:14 +0100
[Message part 1 (text/plain, inline)]
(whitespace-turn-on-if-enabled) gets called multiple times by hooks when a
file is opened. The value of font-lock-keywords is changed by the first
call, and subsequent calls record that value into
whitespace-font-lock-keywords. When GWM is disabled, the value restored to
font-lock-keywords still includes highlighting for white space characters.

How's this change?

*** whitespace.el.orig    Thu May 16 15:22:05 2013
--- whitespace.el    Thu May 16 15:22:59 2013
*************** resultant list will be returned."
*** 2176,2183 ****
    (add-hook 'write-file-functions 'whitespace-write-file-hook nil t)
    ;; create whitespace local buffer environment
    (set (make-local-variable 'whitespace-font-lock-mode) nil)
!   (set (make-local-variable 'whitespace-font-lock) nil)
!   (set (make-local-variable 'whitespace-font-lock-keywords) nil)
    (set (make-local-variable 'whitespace-display-table) nil)
    (set (make-local-variable 'whitespace-display-table-was-local) nil)
    (set (make-local-variable 'whitespace-active-style)
--- 2176,2184 ----
    (add-hook 'write-file-functions 'whitespace-write-file-hook nil t)
    ;; create whitespace local buffer environment
    (set (make-local-variable 'whitespace-font-lock-mode) nil)
!   (unless whitespace-font-lock
!     (set (make-local-variable 'whitespace-font-lock) nil)
!     (set (make-local-variable 'whitespace-font-lock-keywords) nil))
    (set (make-local-variable 'whitespace-display-table) nil)
    (set (make-local-variable 'whitespace-display-table-was-local) nil)
    (set (make-local-variable 'whitespace-active-style)


Regards,
Jeremy Moore
[Message part 2 (text/html, inline)]

This bug report was last modified 8 years and 111 days ago.

Previous Next


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