summaryrefslogtreecommitdiff
path: root/lisp/whitespace.el
diff options
context:
space:
mode:
authorNick Helm <nick@tenpoint.co.nz>2017-05-19 15:20:59 +0300
committerEli Zaretskii <eliz@gnu.org>2017-05-19 15:20:59 +0300
commitc1c6f167b2e683db3e2cee7cb29ab2eb745e1713 (patch)
treee049daba66259b9de5a092be777994fa6df495a1 /lisp/whitespace.el
parent1b0ec9f1b5c2587d6cd402f59f8ec14d81d3e551 (diff)
downloademacs-c1c6f167b2e683db3e2cee7cb29ab2eb745e1713.tar.gz
Fix turning off whitespace-mode
* lisp/whitespace.el (whitespace-display-char-on): Correct the way the original buffer-display-table is saved and restored when global-whitespace-mode is active. (Bug#26892) * test/lisp/whitespace-tests.el (whitespace-tests-whitespace-mode-on): New function. (whitespace-tests-display-tables): New test. Copyright-paperwork-exempt: yes
Diffstat (limited to 'lisp/whitespace.el')
-rw-r--r--lisp/whitespace.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/whitespace.el b/lisp/whitespace.el
index 6aca47cd437..c6d5b16caeb 100644
--- a/lisp/whitespace.el
+++ b/lisp/whitespace.el
@@ -2373,9 +2373,10 @@ Also refontify when necessary."
(let (vecs vec)
;; Remember whether a buffer has a local display table.
(unless whitespace-display-table-was-local
- (setq whitespace-display-table-was-local t
- whitespace-display-table
- (copy-sequence buffer-display-table))
+ (setq whitespace-display-table-was-local t)
+ (unless (or whitespace-mode global-whitespace-mode)
+ (setq whitespace-display-table
+ (copy-sequence buffer-display-table)))
;; Assure `buffer-display-table' is unique
;; when two or more windows are visible.
(setq buffer-display-table