GNU bug report logs - #78201
Suggest show-trailing-whitespace customize option "unless special"

Previous Next

Package: emacs;

Reported by: Joel Reicher <joel.reicher <at> gmail.com>

Date: Fri, 2 May 2025 02:10:01 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Joel Reicher <joel.reicher <at> gmail.com>
To: 78201 <at> debbugs.gnu.org
Subject: bug#78201: Suggest show-trailing-whitespace customize option "unless special"
Date: Fri, 02 May 2025 12:09:03 +1000
A global value of t for show-trailing-whitespace is often not 
useful as some special modes insert trailing whitespace that can't 
(by definition) be edited.

When users want something like this they probably "really mean" to 
show trailing whitespace in all and only editable modes, 
i.e. non-special ones.

I've had pretty good success with

(add-hook 'change-major-mode-after-body-hook (lambda () (if (not 
(eq (get major-mode 'mode-class) 'special)) (setq 
show-trailing-whitespace t))))

which also allows an explicit exception for diff mode (as 
mentioned in bug#75993 it was missing the special mode class).

Thanks and regards,

      - Joel




This bug report was last modified 19 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.