From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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 Message-ID: <835yjmho8k.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4651"; mail-complaints-to="usenet@ciao.gmane.io" Cc: michael_heerdegen@web.de, yet@ego.team, 56679@debbugs.gnu.org To: YE Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 24 11:09:13 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oFXbs-00010P-U2 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Jul 2022 11:09:13 +0200 Original-Received: from localhost ([::1]:57896 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oFXbr-0001Nq-Sz for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Jul 2022 05:09:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35358) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFXbi-0001NH-Qd for bug-gnu-emacs@gnu.org; Sun, 24 Jul 2022 05:09:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57086) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oFXbi-0005Go-I4 for bug-gnu-emacs@gnu.org; Sun, 24 Jul 2022 05:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oFXbi-0007j6-ED for bug-gnu-emacs@gnu.org; Sun, 24 Jul 2022 05:09:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Jul 2022 09:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56679 X-GNU-PR-Package: emacs Original-Received: via spool by 56679-submit@debbugs.gnu.org id=B56679.165865371829657 (code B ref 56679); Sun, 24 Jul 2022 09:09:02 +0000 Original-Received: (at 56679) by debbugs.gnu.org; 24 Jul 2022 09:08:38 +0000 Original-Received: from localhost ([127.0.0.1]:46834 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oFXbJ-0007iB-Vj for submit@debbugs.gnu.org; Sun, 24 Jul 2022 05:08:38 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:50630) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oFXbG-0007hd-Gt for 56679@debbugs.gnu.org; Sun, 24 Jul 2022 05:08:36 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:55584) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFXbB-0005Et-8G; Sun, 24 Jul 2022 05:08:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=5p4iy8zLWGeKqxf5G5z0vDMTmA4L3iAhsh1Q/Qegywc=; b=a3WvAwYTZesw sqwIz1H9iVkKTKQJ4hnloEDC2dSBbuR1/Zjn4xOSOIjO2ldA49kOvFSIZ1C/Fsl2dW84Z0ccLKTqm CZgzsje2hSvDgvUPOJubwXgq3AZbp83vjUGyHftDyU0QkXdKtxthFpz0cMeVkUPU405E+D7wndjek oRdaV5QJSHNaMNUIuHn/9SjaZKtXSNiKXKSBRqrLd39yuPQn4UwC6vrfNNSSnlTLBcv0jSyTEdGz0 5C3pJ+PSiv6fLtk85l9XHq9QtLNCgoNR7anvWYNa08vAELwmlhzj7RMaxGhEhhHZquZo3beZnlprY 3m1D/WAi4vfINNFyLnY8VA==; Original-Received: from [87.69.77.57] (port=3112 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFXbA-0002py-ND; Sun, 24 Jul 2022 05:08:29 -0400 In-Reply-To: (bug-gnu-emacs@gnu.org) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:237819 Archived-At: > Cc: yet@ego.team, 56679@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" > > > 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?