mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
Highlight non-standard whitespace in file buffers
Prevents whitespace-mode from being enabled in special buffers (like circe).
This commit is contained in:
@ -464,14 +464,13 @@ instead). Meant for `kill-buffer-query-functions'."
|
|||||||
e.g. If you indent with spaces by default, tabs will be highlighted. If you
|
e.g. If you indent with spaces by default, tabs will be highlighted. If you
|
||||||
indent with tabs, spaces at BOL are highlighted.
|
indent with tabs, spaces at BOL are highlighted.
|
||||||
|
|
||||||
Does nothing if `whitespace-mode' is already active or the current major mode is
|
Does nothing if `whitespace-mode' is already active or the current buffer is
|
||||||
derived from `special-mode'."
|
read-only or not file-visiting."
|
||||||
(unless (or (bound-and-true-p global-whitespace-mode)
|
(unless (or (bound-and-true-p global-whitespace-mode)
|
||||||
(bound-and-true-p whitespace-mode)
|
(bound-and-true-p whitespace-mode)
|
||||||
(eq major-mode 'fundamental-mode)
|
(eq major-mode 'fundamental-mode)
|
||||||
(eq (get major-mode 'mode-class) 'special)
|
buffer-read-only
|
||||||
(derived-mode-p 'special-mode)
|
(null buffer-file-name))
|
||||||
buffer-read-only)
|
|
||||||
(require 'whitespace)
|
(require 'whitespace)
|
||||||
(set (make-local-variable 'whitespace-style)
|
(set (make-local-variable 'whitespace-style)
|
||||||
(if (bound-and-true-p whitespace-newline-mode)
|
(if (bound-and-true-p whitespace-newline-mode)
|
||||||
|
Reference in New Issue
Block a user