From 49352abbfc061f8722252713909eee274a7cc0b6 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Sun, 15 Jun 2025 12:08:06 +0200 Subject: [PATCH] Only show trailing whitespace in text-mode and prog-mode --- init.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/init.el b/init.el index 1744d59..0d49dfc 100644 --- a/init.el +++ b/init.el @@ -153,8 +153,7 @@ redisplay-skip-fontification-on-input t undo-limit 80000000 async-shell-command-buffer 'new-buffer - indicate-buffer-boundaries 'left - show-trailing-whitespace t) + indicate-buffer-boundaries 'left) (setq byte-compile-warnings '(not docstrings)) ; yields warning when used with setopt @@ -543,7 +542,8 @@ split horizontally again, but this extra work should not matter much." (add-hook 'text-mode-hook 'page-break-lines-mode) (add-hook 'text-mode-hook 'turn-on-auto-fill) (add-hook 'text-mode-hook 'abbrev-mode) - (add-hook 'text-mode-hook 'hl-line-mode))) + (add-hook 'text-mode-hook 'hl-line-mode) + (add-hook 'text-mode-hook #'(lambda () (setq show-trailing-whitespace t))))) (use-package abbrev :init (setq save-abbrevs 'silently @@ -1548,7 +1548,8 @@ Note that this workaround is incomplete, as explained in this comment." (add-hook 'prog-mode-hook 'electric-indent-local-mode) (add-hook 'prog-mode-hook 'hl-line-mode) (add-hook 'prog-mode-hook 'page-break-lines-mode) - (add-hook 'prog-mode-hook 'display-fill-column-indicator-mode))) + (add-hook 'prog-mode-hook 'display-fill-column-indicator-mode) + (add-hook 'prog-mode-hook #'(lambda () (setq show-trailing-whitespace t))))) (use-package diff-hl :ensure t