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

To reply to this bug, email your comments to 78201 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#78201; Package emacs. (Fri, 02 May 2025 02:10:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joel Reicher <joel.reicher <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 02 May 2025 02:10:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Joel Reicher <joel.reicher <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78201; Package emacs. (Fri, 02 May 2025 06:32:01 GMT) Full text and rfc822 format available.

Message #8 received at 78201 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Joel Reicher <joel.reicher <at> gmail.com>
Cc: 78201 <at> debbugs.gnu.org
Subject: Re: bug#78201: Suggest show-trailing-whitespace customize option
 "unless special"
Date: Fri, 02 May 2025 09:31:34 +0300
> From: Joel Reicher <joel.reicher <at> gmail.com>
> 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.

Those modes are quite rare.  So I suggest instead to submit patches to
those rare modes to customize the buffer-local value of
show-trailing-whitespace in buffers under those modes.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78201; Package emacs. (Thu, 29 May 2025 10:28:02 GMT) Full text and rfc822 format available.

Message #11 received at 78201 <at> debbugs.gnu.org (full text, mbox):

From: Joel Reicher <joel.reicher <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 78201 <at> debbugs.gnu.org
Subject: Re: bug#78201: Suggest show-trailing-whitespace customize option
 "unless special"
Date: Thu, 29 May 2025 20:27:45 +1000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> 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.
>
> Those modes are quite rare.  So I suggest instead to submit 
> patches to those rare modes to customize the buffer-local value 
> of show-trailing-whitespace in buffers under those modes.

While I'm not disagreeing with this, I think the existence of code 
such as

(defcustom show-paren-predicate '(not (derived-mode 
. special-mode))...

indicates there is at least a precedent for the approach.

Also (and this might warrant a separate bug report) I think there 
is a discrepancy between being derived from special and having 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.