From 997140692fbd58494ac172ee507bb5e218595083 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Mon, 21 Oct 2024 12:33:28 +0200 Subject: emacs: Set show-trailing-whitespace only in specific modes --- .config/emacs/init.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to '.config') diff --git a/.config/emacs/init.el b/.config/emacs/init.el index b73a7fa..a88d5e6 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -149,7 +149,6 @@ buffer suppressed." (save-interprogram-paste-before-kill t) (scroll-conservatively 101) ; (info "(Emacs)Auto Scrolling") (scroll-error-top-bottom t) - (show-trailing-whitespace t) (user-full-name "Thomas Voss") (user-mail-address "mail@thomasvoss.com") (vc-follow-symlinks t) @@ -166,6 +165,12 @@ buffer suppressed." (add-hook 'text-mode-hook #'auto-fill-mode) (prefer-coding-system 'utf-8) + ;; Show trailing whitespace but only in relevant buffers + (dolist (mode '(conf-mode prog-mode text-mode)) + (add-hook (mm-mode-to-hook mode) + (defun mm-show-trailing-whitespace () + (setopt show-trailing-whitespace t)))) + ;; Disabled modes (blink-cursor-mode -1) (line-number-mode -1) -- cgit v1.2.3