From bc67572084726572972170f0f2133f4050e8136d Mon Sep 17 00:00:00 2001 From: Timo Wilken Date: Tue, 31 Oct 2023 17:15:09 +0100 Subject: Be less aggressive about trailing whitespace --- tw/home/files/emacs-init.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tw/home') diff --git a/tw/home/files/emacs-init.el b/tw/home/files/emacs-init.el index 1fea6749..12f8e5e3 100644 --- a/tw/home/files/emacs-init.el +++ b/tw/home/files/emacs-init.el @@ -54,7 +54,6 @@ If CREATE is true and the resulting directory does not exist, create it." (sentence-end-double-space nil "Use a single space after a sentence.") (fill-column 78 "Make hard-wrapped text a bit wider.") (require-final-newline t "Always add a final newline on save, if there is none.") - (show-trailing-whitespace t "Always show trailing spaces.") ;; Make Emacs a good Guix citizen. (package-archives nil "Don't fetch packages from the internet; only get them from Guix.") ;; Default mode. @@ -95,12 +94,13 @@ If CREATE is true and the resulting directory does not exist, create it." (add-hook 'mail-mode-hook #'auto-fill-mode) -(defun tw/hide-trailing-whitespace () - "Don't highlight trailing whitespace for this buffer." - (setq-local show-trailing-whitespace nil)) +(defun tw/show-trailing-whitespace () + "Highlight trailing spaces in the current buffer." + (setq-local show-trailing-whitespace t)) -(add-hook 'help-mode-hook #'tw/hide-trailing-whitespace) -(add-hook 'eww-mode-hook #'tw/hide-trailing-whitespace) +(mapc (lambda (hook) + (add-hook hook #'tw/show-trailing-whitespace)) + '(prog-mode-hook conf-mode-hook yaml-mode-hook alidist-mode-hook)) (defun tw/enable-word-wrap () "Enable word wrapping." -- cgit v1.2.3