From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: YE via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#56679: 28.1; [PATCH] whitespace-style cannot be configured for diff-mode via hook Date: Tue, 26 Jul 2022 15:27:18 +0300 Message-ID: References: Reply-To: YE Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5113"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, eliz@gnu.org, yet@ego.team, 56679@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 26 14:28:17 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 1oGJfd-0001Bq-B7 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 26 Jul 2022 14:28:17 +0200 Original-Received: from localhost ([::1]:33408 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oGJfc-0007n1-Et for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 26 Jul 2022 08:28:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34936) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGJfO-0007mq-5P for bug-gnu-emacs@gnu.org; Tue, 26 Jul 2022 08:28:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34524) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oGJfN-0000cU-R4 for bug-gnu-emacs@gnu.org; Tue, 26 Jul 2022 08:28:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oGJfN-00015M-MV for bug-gnu-emacs@gnu.org; Tue, 26 Jul 2022 08:28:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: YE Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Jul 2022 12:28:01 +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.16588384454115 (code B ref 56679); Tue, 26 Jul 2022 12:28:01 +0000 Original-Received: (at 56679) by debbugs.gnu.org; 26 Jul 2022 12:27:25 +0000 Original-Received: from localhost ([127.0.0.1]:52506 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oGJen-00014I-1c for submit@debbugs.gnu.org; Tue, 26 Jul 2022 08:27:25 -0400 Original-Received: from out1.migadu.com ([91.121.223.63]:53648) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oGJek-00014A-Kb for 56679@debbugs.gnu.org; Tue, 26 Jul 2022 08:27:23 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ego.team; s=key1; t=1658838440; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to; bh=Nmgjj7ds42G3b5YkyzCVroqJ8aBeaT3KNK/+pQkZmEg=; b=AXbE0w1irQ5paeI9AyZxFu1763Qnoy+2tT781IW6/WW4g1jClna4Tba2ZrzoT171qLfJvN YlwGNV1FVIJDpUGoOLKnH9geznJX2dcBt591U/kfEmIdLEnwHUe6O+PX+601q2r2ApsIJV WoeARoi0Q818eeNZe4WBUjWBhUgc/fw= In-Reply-To: <87k0801q3p.fsf@web.de> (message from Michael Heerdegen on Tue, 26 Jul 2022 05:59:22 +0200) X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: ego.team 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" X-ACL-Warn: , YE Xref: news.gmane.io gmane.emacs.bugs:237951 Archived-At: --=-=-= Content-Type: text/plain > YE, could you maybe try to take care of Elis hints? Sure. See attached. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Improve-diff-whitespace-style-user-option-declaratio.patch Content-Description: Improve 'diff-whitespace-style' user option declaration >From 2c4b52d4b9cb9728e2de8d8e01f27c73fb0a0f8d Mon Sep 17 00:00:00 2001 From: YugaEgo Date: Tue, 26 Jul 2022 15:17:44 +0300 Subject: [PATCH] Improve 'diff-whitespace-style' user option declaration * lisp/vc/diff-mode.el (diff-whitespace-style): Use ':require'. Minor docstring fix. (top level): Do not require 'whitespace. (whitespace-style, whitespace-trailing-regexp): Add defvars (rollback recent removal). * etc/NEWS: Extend 'diff-whitespace-style' introduction. (Bug#56679). --- etc/NEWS | 4 +++- lisp/vc/diff-mode.el | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 1d0e45fdcc..86780165e9 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1194,7 +1194,9 @@ contents. --- *** New user option 'diff-whitespace-style'. -This option determines buffer-local 'whitespace-style' value. +Sets the value of the buffer-local variable 'whitespace-style' in +'diff-mode' buffers. By default, this variable is '(face trailing)', +which preserves behavior from previous Emacs versions. ** Ispell diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 8d9caf35a3..aa426446d7 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -56,7 +56,6 @@ (eval-when-compile (require 'cl-lib)) (eval-when-compile (require 'subr-x)) (require 'easy-mmode) -(require 'whitespace) (autoload 'vc-find-revision "vc") (autoload 'vc-find-revision-no-save "vc") @@ -149,7 +148,8 @@ diff-font-lock-syntax (const :tag "Allow hunk-based fallback" hunk-also))) (defcustom diff-whitespace-style '(face trailing) - "Specify `whitespace-style' variable for the current Diff mode buffer." + "Specify `whitespace-style' variable for `diff-mode' buffers." + :require 'whitespace :type (get 'whitespace-style 'custom-type) :version "29.1") @@ -1490,6 +1490,9 @@ diff-mode-read-only (nconc minor-mode-map-alist (list (cons 'diff-mode-read-only diff-mode-shared-map)))) +(defvar whitespace-style) +(defvar whitespace-trailing-regexp) + ;;;###autoload (define-derived-mode diff-mode fundamental-mode "Diff" "Major mode for viewing/editing context diffs. -- 2.34.1 --=-=-=--