diff options
| author | Lars Ingebrigtsen | 2021-09-21 07:23:09 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2021-09-21 07:23:09 +0200 |
| commit | 02a2fba7869db7ae23c65ab1ea47db7ba556ffac (patch) | |
| tree | d5a3ce5b8b58c5f4f47a13c68e3646532bd27da9 | |
| parent | f4813b23f26b3d3af2c098ae55091e7f7cd763cd (diff) | |
| download | emacs-02a2fba7869db7ae23c65ab1ea47db7ba556ffac.tar.gz emacs-02a2fba7869db7ae23c65ab1ea47db7ba556ffac.zip | |
Use `special-mode' for whitespace-report
* lisp/whitespace.el (whitespace-report-region): Use
`special-mode' instead of `fundamental-mode' (bug#50715).
| -rw-r--r-- | lisp/whitespace.el | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/lisp/whitespace.el b/lisp/whitespace.el index 7e090177eb7..08f809a5aad 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el | |||
| @@ -1722,30 +1722,32 @@ cleaning up these problems." | |||
| 1722 | (ws-tab-width tab-width)) | 1722 | (ws-tab-width tab-width)) |
| 1723 | (with-current-buffer (get-buffer-create | 1723 | (with-current-buffer (get-buffer-create |
| 1724 | whitespace-report-buffer-name) | 1724 | whitespace-report-buffer-name) |
| 1725 | (erase-buffer) | 1725 | (let ((inhibit-read-only t)) |
| 1726 | (insert (if ws-indent-tabs-mode | 1726 | (special-mode) |
| 1727 | (car whitespace-report-text) | 1727 | (erase-buffer) |
| 1728 | (cdr whitespace-report-text))) | 1728 | (insert (if ws-indent-tabs-mode |
| 1729 | (goto-char (point-min)) | 1729 | (car whitespace-report-text) |
| 1730 | (forward-line 3) | 1730 | (cdr whitespace-report-text))) |
| 1731 | (dolist (option whitespace-report-list) | 1731 | (goto-char (point-min)) |
| 1732 | (forward-line 3) | ||
| 1733 | (dolist (option whitespace-report-list) | ||
| 1734 | (forward-line 1) | ||
| 1735 | (whitespace-mark-x | ||
| 1736 | 27 (memq (car option) style)) | ||
| 1737 | (whitespace-mark-x 7 (car bogus-list)) | ||
| 1738 | (setq bogus-list (cdr bogus-list))) | ||
| 1732 | (forward-line 1) | 1739 | (forward-line 1) |
| 1733 | (whitespace-mark-x | 1740 | (whitespace-insert-value ws-indent-tabs-mode) |
| 1734 | 27 (memq (car option) style)) | 1741 | (whitespace-insert-value ws-tab-width) |
| 1735 | (whitespace-mark-x 7 (car bogus-list)) | 1742 | (when has-bogus |
| 1736 | (setq bogus-list (cdr bogus-list))) | 1743 | (goto-char (point-max)) |
| 1737 | (forward-line 1) | 1744 | (insert (substitute-command-keys |
| 1738 | (whitespace-insert-value ws-indent-tabs-mode) | 1745 | " Type `\\[whitespace-cleanup]'") |
| 1739 | (whitespace-insert-value ws-tab-width) | 1746 | " to cleanup the buffer.\n\n" |
| 1740 | (when has-bogus | 1747 | (substitute-command-keys |
| 1741 | (goto-char (point-max)) | 1748 | " Type `\\[whitespace-cleanup-region]'") |
| 1742 | (insert (substitute-command-keys | 1749 | " to cleanup a region.\n\n")) |
| 1743 | " Type `\\[whitespace-cleanup]'") | 1750 | (whitespace-display-window (current-buffer)))))) |
| 1744 | " to cleanup the buffer.\n\n" | ||
| 1745 | (substitute-command-keys | ||
| 1746 | " Type `\\[whitespace-cleanup-region]'") | ||
| 1747 | " to cleanup a region.\n\n")) | ||
| 1748 | (whitespace-display-window (current-buffer))))) | ||
| 1749 | has-bogus))) | 1751 | has-bogus))) |
| 1750 | 1752 | ||
| 1751 | 1753 | ||