From ec93eca67bda549886709ff8c13d563560c88c99 Mon Sep 17 00:00:00 2001 From: Reuben Thomas Date: Fri, 21 Oct 2016 15:25:12 +0100 Subject: [PATCH 4/4] Make whitespace-report-region respect current settings * whitespace.el (whitespace-report-region): make it 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 f8dc950..bbec06e 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el @@ -1733,8 +1733,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