GNU bug report logs -
#26892
25.2; whitespace-mode does not turn off correctly
Previous Next
Reported by: Nick Helm <nick <at> tenpoint.co.nz>
Date: Thu, 11 May 2017 23:36:02 UTC
Severity: minor
Found in version 25.2
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 26892 <at> debbugs.gnu.org (full text, mbox):
> From: Nick Helm <nick <at> tenpoint.co.nz>
> Date: Fri, 12 May 2017 11:34:33 +1200
>
> Emacs -Q
> C-u 20 SPC RET RET RET RET ; type some random whitespace
> M-x global-whitespace-mode
> M-x whitespace-mode
> M-x whitespace-mode
>
> The last command should toggle local whitespace-mode off, but note that the
> whitespace display characters are not properly removed from the current
> buffer.
>
> I had a look at whitespace.el and I think the problem lies in
> `whitespace-display-char-on'. Among other things, this function stores the
> buffer display table and replaces it with a temporary display table to show
> whitespace chars. The original is restored when the mode is turned off.
>
> However, with global-whitespace-mode active, there is already a temporary
> display table in place, which whitespace-mode incorrectly picks up and stores,
> clobbering the original display table in the process. When whitespace-mode is
> turned off, it restores the temporary display table set by
> global-whitespace-mode, which leads to the problem.
>
> Here's a little patch to check if global-whitespace-mode is active before
> storing the display table. I've tried this for a few days with no obvious
> problems.
Did you try running whitespace-tests with this change, and if so, did
they pass?
If the tests pass, would you mind to please add a new test for this
bug?
Thanks.
This bug report was last modified 8 years and 53 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.