summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Wilken2023-10-31 17:15:09 +0100
committerTimo Wilken2023-10-31 17:15:09 +0100
commitbc67572084726572972170f0f2133f4050e8136d (patch)
treef56bf8a60d4642b797957441fa885933808e5d93
parentfa8515d53411c9fba4bcb9088ef3ffa4e3b4da94 (diff)
Be less aggressive about trailing whitespace
-rw-r--r--tw/home/files/emacs-init.el12
1 files changed, 6 insertions, 6 deletions
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."