all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Nick Helm <nick@tenpoint.co.nz>
Cc: 26892@debbugs.gnu.org
Subject: bug#26892: 25.2; whitespace-mode does not turn off correctly
Date: Fri, 12 May 2017 09:19:52 +0300	[thread overview]
Message-ID: <837f1ma96f.fsf@gnu.org> (raw)
In-Reply-To: <m2bmqz9ddi.fsf@tenpoint.co.nz> (message from Nick Helm on Fri, 12 May 2017 11:34:33 +1200)

> From: Nick Helm <nick@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.





  reply	other threads:[~2017-05-12  6:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-11 23:34 bug#26892: 25.2; whitespace-mode does not turn off correctly Nick Helm
2017-05-12  6:19 ` Eli Zaretskii [this message]
2017-05-15  0:26   ` Nick Helm
2017-05-19 12:27     ` Eli Zaretskii
2017-05-21 23:11       ` Nick Helm
2017-05-22  4:10         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=837f1ma96f.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=26892@debbugs.gnu.org \
    --cc=nick@tenpoint.co.nz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.