1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

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).
This commit is contained in:
YugaEgo 2022-07-27 11:52:01 +02:00 committed by Lars Ingebrigtsen
parent bfa951cdfa
commit f21feaf00e
2 changed files with 8 additions and 3 deletions

View file

@ -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

View file

@ -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.