From 2a996815dc9bb8922eb9c31014e6526ed6daacb7 Mon Sep 17 00:00:00 2001 From: Reuben Thomas Date: Fri, 21 Oct 2016 15:25:12 +0100 Subject: [PATCH 4/4] whitespace.el: make whitespace-report-region respect current settings * whitespace.el: make whitespace-report-region respect whitespace-style, including any additions made by the force parameter. This means that the function does not return t unless a whitespace problem that the user cares about is reported. --- lisp/whitespace.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/whitespace.el b/lisp/whitespace.el index b798e7e..5300faf 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el @@ -1732,8 +1732,10 @@ whitespace-report-region (whitespace-space-after-tab-regexp 'space)) (t (cdr option))))) - (and (re-search-forward regexp rend t) - (setq has-bogus t)))) + (when (re-search-forward regexp rend t) + (unless has-bogus + (setq has-bogus (memq (car option) whitespace-style))) + t))) whitespace-report-list))) (when (pcase report-if-bogus (`nil t) (`never nil) (_ has-bogus)) (whitespace-kill-buffer whitespace-report-buffer-name) -- 2.7.4