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

From: Ergus <[email-masked]>
Date: Tue, 27 May 2025 17:06:57 +0000 (UTC)

Hi Eli:

Sorry for the delay, but this email went to spam.
The patch improved a bit, but didn't solved it totally.

I mean:

> M-x standard-display-unicode-special-glyphs ;; This looks as expected
> M-x whitespace-mode ;; reverts the effect
This part of the issue is still there exactly like before.
But, if I do latter:
M-x whitespace-mode ;; disables whitespace and restores special-glyphs
M-x whitespace-mode ;; re-enable whitespace mode and keeps special-glyphs

Then it looks correctly. 

    On Wednesday, May 21, 2025 at 02:31:07 PM GMT+2, Eli Zaretskii <[email-masked]> wrote:   

 > 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)