]> git.eshelyaron.com Git - emacs.git/commitdiff
Make whitespace-report-region respect current settings
authorReuben Thomas <rrt@sc3d.org>
Fri, 21 Oct 2016 14:25:12 +0000 (15:25 +0100)
committerReuben Thomas <rrt@sc3d.org>
Thu, 3 Nov 2016 12:16:56 +0000 (12:16 +0000)
* lisp/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.  (Bug#24745)

lisp/whitespace.el

index 2cf014cc53ecd18a1ef219c03a601016fb15b7b2..a270a19183e7cc99ec82468097380ce40dbcdcbc 100644 (file)
@@ -1740,8 +1740,10 @@ cleaning up these problems."
                            (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)