Subject: bug#78522: 31.0.50; Conflict between standard-display-unicode-special-glyphs and whitespace-mode

From: Eli Zaretskii <[email-masked]>
Date: Wed, 21 May 2025 15:31:02 +0300

> Date: Wed, 21 May 2025 02:11:16 +0200
> From:  Ergus via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> 
> Whitespace mode contradicts the standard-display-unicode-special-glyphs
> effect
> 
> Reproduce:
> ;; -------------------------------
> emacs -Q -nw
> M-x standard-display-unicode-special-glyphs ;; This looks as expected
> M-x whitespace-mode ;; reverts the effect
> ;; -------------------------------
> 
> The only way to get back the effect of
> standard-display-unicode-special-glyphs is disabling whitespace-mode.

Does the patch below fix the problem?

diff --git a/lisp/whitespace.el b/lisp/whitespace.el
index 1042575..58ba0db 100644
--- a/lisp/whitespace.el
+++ b/lisp/whitespace.el
@@ -2480,7 +2480,8 @@ whitespace-display-char-on
 	;; Assure `buffer-display-table' is unique
 	;; when two or more windows are visible.
 	(setq buffer-display-table
-	      (copy-sequence buffer-display-table)))
+	      (copy-sequence (or buffer-display-table
+                                 standard-display-table))))
       (unless buffer-display-table
 	(setq buffer-display-table (make-display-table)))
       (dolist (entry whitespace-display-mappings)