module!: add :editor whitespace

BREAKING CHANGE: Moves ws-butler, dtrt-indent, and whitespace defaults
out of Doom's core and into a new module. ws-butler is gated behind
+trim and dtrt-indent behind +guess. Users who depend on/like these
packages will need to enable the new module and their respective
flags (which is the default going forward).

This change is motivated by an ongoing effort to slim down Doom's
core (by (re)moving non-essentials from it).

This also addresses an issue where dtrt-indent would vastly increase
load times for some major-modes (e.g. elixir-mode & elm-mode, see #7537)
by restricting it to non-project files and non-read-only buffers AND
excludign those two major modes from indent guessing.

Fix: #8516
Fix: #7537
This commit is contained in:
Henrik Lissner
2025-09-24 01:29:09 -04:00
parent 22f86d25e9
commit fbdde6b5f4
16 changed files with 215 additions and 143 deletions

View File

@@ -359,7 +359,7 @@ Respects `require-final-newline'."
"Change the indentation size to WIDTH of the current buffer.
The effectiveness of this command is significantly improved if you have
editorconfig or dtrt-indent installed."
editorconfig installed."
(interactive
(list (if (integerp current-prefix-arg)
current-prefix-arg
@@ -391,20 +391,6 @@ editorconfig or dtrt-indent installed."
;;
;;; Hooks
;;;###autoload
(defun doom-enable-delete-trailing-whitespace-h ()
"Enables the automatic deletion of trailing whitespaces upon file save.
i.e. enables `ws-butler-mode' in the current buffer."
(ws-butler-mode +1))
;;;###autoload
(defun doom-disable-delete-trailing-whitespace-h ()
"Disables the automatic deletion of trailing whitespaces upon file save.
i.e. disables `ws-butler-mode' in the current buffer."
(ws-butler-mode -1))
;;;###autoload
(defun doom-enable-show-trailing-whitespace-h ()
"Enable `show-trailing-whitespace' in the current buffer."