diff options
| author | Reuben Thomas | 2016-10-21 15:25:12 +0100 |
|---|---|---|
| committer | Reuben Thomas | 2016-11-03 12:16:56 +0000 |
| commit | 2350bb95316f51d42e3abebd199126482c519744 (patch) | |
| tree | 80ba72720841c0383892537f5e2f519a286b9456 | |
| parent | a55c582fdb98d87268fd11e5568d73010cfe0a45 (diff) | |
| download | emacs-2350bb95316f51d42e3abebd199126482c519744.tar.gz emacs-2350bb95316f51d42e3abebd199126482c519744.zip | |
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)
| -rw-r--r-- | lisp/whitespace.el | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/whitespace.el b/lisp/whitespace.el index 2cf014cc53e..a270a19183e 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el | |||
| @@ -1740,8 +1740,10 @@ cleaning up these problems." | |||
| 1740 | (whitespace-space-after-tab-regexp 'space)) | 1740 | (whitespace-space-after-tab-regexp 'space)) |
| 1741 | (t | 1741 | (t |
| 1742 | (cdr option))))) | 1742 | (cdr option))))) |
| 1743 | (and (re-search-forward regexp rend t) | 1743 | (when (re-search-forward regexp rend t) |
| 1744 | (setq has-bogus t)))) | 1744 | (unless has-bogus |
| 1745 | (setq has-bogus (memq (car option) whitespace-style))) | ||
| 1746 | t))) | ||
| 1745 | whitespace-report-list))) | 1747 | whitespace-report-list))) |
| 1746 | (when (pcase report-if-bogus (`nil t) (`never nil) (_ has-bogus)) | 1748 | (when (pcase report-if-bogus (`nil t) (`never nil) (_ has-bogus)) |
| 1747 | (whitespace-kill-buffer whitespace-report-buffer-name) | 1749 | (whitespace-kill-buffer whitespace-report-buffer-name) |