GNU bug report logs - #56679
28.1; whitespace-style cannot be configured for diff-mode via hook

Previous Next

Package: emacs;

Reported by: YE <yet <at> ego.team>

Date: Thu, 21 Jul 2022 14:47:01 UTC

Severity: normal

Found in version 28.1

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: YE <yet <at> ego.team>
Cc: michael_heerdegen <at> web.de, yet <at> ego.team, 56679 <at> debbugs.gnu.org
Subject: bug#56679: 28.1; [PATCH] whitespace-style cannot be configured for diff-mode via hook
Date: Sun, 24 Jul 2022 12:08:27 +0300
> Cc: yet <at> ego.team, 56679 <at> debbugs.gnu.org
> Date: Sun, 24 Jul 2022 10:49:33 +0300
> From:  YE via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> > I think you don't need a duplication.  You can reuse an existing type
> > definition by looking up the `custom-type` symbol property of an already
> > defined option.  See e.g. "lisp/eshell/em-cmpl.el" for a few example
> > definitions.
> 
> Thanks for the advice.
> 
> The proposed patch is attached.

Thanks.

> --- a/lisp/vc/diff-mode.el
> +++ b/lisp/vc/diff-mode.el
> @@ -56,6 +56,7 @@
>  (eval-when-compile (require 'cl-lib))
>  (eval-when-compile (require 'subr-x))
>  (require 'easy-mmode)
> +(require 'whitespace)

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.

> +(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?

> +** 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?




This bug report was last modified 2 years and 354 days ago.

Previous Next


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