From: YE via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: larsi@gnus.org, eliz@gnu.org, yet@ego.team, 56679@debbugs.gnu.org
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 [thread overview]
Message-ID: <m2lesgjbyx.fsf@ego.team> (raw)
In-Reply-To: <87k0801q3p.fsf@web.de> (message from Michael Heerdegen on Tue, 26 Jul 2022 05:59:22 +0200)
[-- Attachment #1: Type: text/plain, Size: 76 bytes --]
> YE, could you maybe try to take care of Elis hints?
Sure. See attached.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Improve 'diff-whitespace-style' user option declaration --]
[-- Type: text/x-patch, Size: 2187 bytes --]
From 2c4b52d4b9cb9728e2de8d8e01f27c73fb0a0f8d Mon Sep 17 00:00:00 2001
From: YugaEgo <yet@ego.team>
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
next prev parent reply other threads:[~2022-07-26 12:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-21 14:46 bug#56679: 28.1; whitespace-style cannot be configured for diff-mode via hook YE via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-23 0:15 ` Michael Heerdegen
2022-07-24 7:49 ` bug#56679: 28.1; [PATCH] " YE via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-24 9:02 ` Lars Ingebrigtsen
2022-07-24 9:08 ` Eli Zaretskii
2022-07-25 2:38 ` Michael Heerdegen
2022-07-25 11:07 ` Eli Zaretskii
2022-07-26 3:59 ` Michael Heerdegen
2022-07-26 12:27 ` YE via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-07-27 9:52 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2lesgjbyx.fsf@ego.team \
--to=bug-gnu-emacs@gnu.org \
--cc=56679@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=larsi@gnus.org \
--cc=michael_heerdegen@web.de \
--cc=yet@ego.team \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).