diff options
| author | Reuben Thomas | 2014-05-29 23:51:47 +0100 |
|---|---|---|
| committer | Reuben Thomas | 2014-05-29 23:51:47 +0100 |
| commit | b4c1ce8a95e03cb306c31ffc4beb70476cb8f575 (patch) | |
| tree | 77322f367f0c7d455e0eb758b435698811e109a1 | |
| parent | b0877c4488a7a10e32e5602fc0b070222e773c02 (diff) | |
| download | emacs-b4c1ce8a95e03cb306c31ffc4beb70476cb8f575.tar.gz emacs-b4c1ce8a95e03cb306c31ffc4beb70476cb8f575.zip | |
Improve non-interactive use of whitespace reporting
whitespace.el (whitespace-report-region): Allow report-if-bogus to take
the value `never', for non-interactive use.
| -rw-r--r-- | lisp/ChangeLog | 2 | ||||
| -rw-r--r-- | lisp/whitespace.el | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 12b194483ff..a94f977e755 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -2,6 +2,8 @@ | |||
| 2 | 2 | ||
| 3 | * whitespace.el (whitespace-report-region): Simplify | 3 | * whitespace.el (whitespace-report-region): Simplify |
| 4 | documentation. | 4 | documentation. |
| 5 | (whitespace-report-region): Allow report-if-bogus to take the | ||
| 6 | value `never', for non-interactive use. | ||
| 5 | (whitespace-report): Refer to whitespace-report-region's | 7 | (whitespace-report): Refer to whitespace-report-region's |
| 6 | documentation. | 8 | documentation. |
| 7 | 9 | ||
diff --git a/lisp/whitespace.el b/lisp/whitespace.el index c67733623dc..917f0432ef2 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el | |||
| @@ -1737,13 +1737,14 @@ before calling `whitespace-report-region' interactively, it | |||
| 1737 | forces `whitespace-style' to have: | 1737 | forces `whitespace-style' to have: |
| 1738 | 1738 | ||
| 1739 | empty | 1739 | empty |
| 1740 | trailing | ||
| 1740 | indentation | 1741 | indentation |
| 1741 | space-before-tab | 1742 | space-before-tab |
| 1742 | trailing | ||
| 1743 | space-after-tab | 1743 | space-after-tab |
| 1744 | 1744 | ||
| 1745 | If REPORT-IF-BOGUS is non-nil, it reports only when there are any | 1745 | If REPORT-IF-BOGUS is t, it reports only when there are any |
| 1746 | whitespace problems in buffer. | 1746 | whitespace problems in buffer; if it is `never', it does not |
| 1747 | report problems. | ||
| 1747 | 1748 | ||
| 1748 | Report if some of the following whitespace problems exist: | 1749 | Report if some of the following whitespace problems exist: |
| 1749 | 1750 | ||
| @@ -1798,7 +1799,7 @@ cleaning up these problems." | |||
| 1798 | (and (re-search-forward regexp rend t) | 1799 | (and (re-search-forward regexp rend t) |
| 1799 | (setq has-bogus t)))) | 1800 | (setq has-bogus t)))) |
| 1800 | whitespace-report-list))) | 1801 | whitespace-report-list))) |
| 1801 | (when (if report-if-bogus has-bogus t) | 1802 | (when (pcase report-if-bogus (`nil t) (`never nil) (_ has-bogus)) |
| 1802 | (whitespace-kill-buffer whitespace-report-buffer-name) | 1803 | (whitespace-kill-buffer whitespace-report-buffer-name) |
| 1803 | ;; `whitespace-indent-tabs-mode' is local to current buffer | 1804 | ;; `whitespace-indent-tabs-mode' is local to current buffer |
| 1804 | ;; `whitespace-tab-width' is local to current buffer | 1805 | ;; `whitespace-tab-width' is local to current buffer |