1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 18:40:39 -08:00

Make whitespace-report-region respect current settings

* 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)
This commit is contained in:
Reuben Thomas 2016-10-21 15:25:12 +01:00
parent a55c582fdb
commit 2350bb9531

View 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)