emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master f21feaf00e: Improve 'diff-whitespace-style' user option declarati


From: Lars Ingebrigtsen
Subject: master f21feaf00e: Improve 'diff-whitespace-style' user option declaration
Date: Wed, 27 Jul 2022 05:52:28 -0400 (EDT)

branch: master
commit f21feaf00e78087dc6bed930695f449a52541bee
Author: YugaEgo <yet@ego.team>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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) (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 7c1462ee57..b79e216aa0 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1206,7 +1206,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 @@ and hunk-based syntax highlighting otherwise as a fallback."
                  (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 @@ See `after-change-functions' for the meaning of BEG, END 
and LEN."
     (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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]