@item C-c C-w
@findex diff-ignore-whitespace-hunk
-Re-generate the current hunk, disregarding changes in whitespace
+Re-generate the current hunk, disregarding changes in whitespace.
+With a non-@code{nil} prefix arg, re-generate all the hunks
(@code{diff-ignore-whitespace-hunk}).
@item C-x 4 A
switches for shortlogs, such as the one produced by 'C-x v L'.
'vc-git-log-switches' is no longer used for shortlogs.
+** Diff Mode
+
++++
+*** 'diff-ignore-whitespace-hunk' can now be applied to all hunks.
+When called with a non-nil prefix argument
+'diff-ignore-whitespace-hunk' now iterates over all the hunks in the
+current diff, regenerating them without whitespace changes.
+
** Buffer Selection
---
(goto-char (+ (car pos) (cdr src)))
(add-log-current-defun)))))))
-(defun diff-ignore-whitespace-hunk ()
- "Re-diff the current hunk, ignoring whitespace differences."
- (interactive)
- (diff-refresh-hunk t))
+(defun diff-ignore-whitespace-hunk (&optional whole-buffer)
+ "Re-diff the current hunk, ignoring whitespace differences.
+With non-nil prefix arg, re-diff all the hunks."
+ (interactive "P")
+ (if whole-buffer
+ (diff--ignore-whitespace-all-hunks)
+ (diff-refresh-hunk t)))
(defun diff-refresh-hunk (&optional ignore-whitespace)
"Re-diff the current hunk."
(or (ignore-errors (diff-hunk-next) (point))
max)))))))))
+;; This doesn't use `diff--iterate-hunks', since that assumes that
+;; hunks don't change size.
+(defun diff--ignore-whitespace-all-hunks ()
+ "Re-diff all the hunks, ignoring whitespace-differences."
+ (save-excursion
+ (goto-char (point-min))
+ (diff-hunk-next)
+ (while (looking-at diff-hunk-header-re)
+ (diff-refresh-hunk t))))
+
(defun diff--font-lock-refined (max)
"Apply hunk refinement from font-lock."
(when (eq diff-refine 'font-lock)