Subject: bug#56679: 28.1; [PATCH] whitespace-style cannot be configured for diff-mode via hook

From: Michael Heerdegen <[email-masked]>
Date: Mon, 25 Jul 2022 04:38:18 +0200

Eli Zaretskii <[email-masked]> writes:

> Can we delay loading whitespace.el until the user actually wants to
> turn on whitespace-mode, or until he/she customizes this option?
> AFAIU, whitespace-mode is not turned on unconditionally by diff-mode,
> so this 'require' is not needed for users who don't turn that minor
> mode in Diff buffers.

Principally correct - but how do we do this correctly for the
(get 'whitespace-style 'custom-type) :type definition?

> > +(defcustom diff-whitespace-style '(face trailing)
> > +  "Specify `whitespace-style' variable for the current Diff mode buffer."
>
> AFAIU, this style will be applied to all Diff mode buffers, not just
> the "current" one.  Right?

Yes, that, and also the language of the News entry, is a bit misleading.

> > +** Diff mode
> > +
> > +---
> > +*** New user option 'diff-whitespace-style'.
> > +This option determines buffer-local 'whitespace-style' value.
>
> Should we tell that if someone was using whitespace-style directly for
> this purpose, they should use this new option instead?

AFAIU this never worked, this is what this patch is about (unless those
someones knew some trick maybe).

Michael.