summary refs log tree commit diff stats
path: root/emacs
diff options
context:
space:
mode:
authorAlan Pearce2017-04-27 11:58:39 +0200
committerAlan Pearce2017-04-27 11:58:39 +0200
commit8a2b251810f31e6fe4caf1217d3647a32fceb905 (patch)
treea91466087fb2f934855401b110bd6ef6ab0a5582 /emacs
parentbb46cf8f8ff70e89514f30a07b0619df23b6f09d (diff)
downloaddotfiles-8a2b251810f31e6fe4caf1217d3647a32fceb905.tar.lz
dotfiles-8a2b251810f31e6fe4caf1217d3647a32fceb905.tar.zst
dotfiles-8a2b251810f31e6fe4caf1217d3647a32fceb905.zip
Emacs: Use built-in trailing whitespace instead of ws-butler
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.emacs.d/init.org22
1 files changed, 11 insertions, 11 deletions
diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org
index c99e957..a044121 100644
--- a/emacs/.emacs.d/init.org
+++ b/emacs/.emacs.d/init.org
@@ -669,20 +669,20 @@ with a buffer.
         (kill-buffer buf)))))
 #+END_SRC
 
-** Whitespace Butler
+** Whitespace
 
-I don’t like it when editors change an entire file’s layout when I
-open it.  Whitespace butler fixes whitespace only for lines that I’m editing.
+Show bad whitespace, so that I can fix it.
 
 #+BEGIN_SRC emacs-lisp
-(use-package ws-butler
-  :if window-system
-  :diminish ws-butler-mode
-  :config (ws-butler-global-mode 1))
-(if (daemonp)
-    (add-hook 'before-make-frame-hook (lambda ()
-                                        (use-package ws-butler
-                                          :config (ws-butler-global-mode 1)))))
+(defun show-trailing-whitespace-on ()
+  (interactive)
+  (setq-local show-trailing-whitespace t))
+(defun show-trailing-whitespace-off ()
+  (interactive)
+  (setq-local show-trailing-whitespace nil))
+(add-hook 'prog-mode-hook #'show-trailing-whitespace-on)
+(add-hook 'text-mode-hook #'show-trailing-whitespace-on)
+(setq-default show-trailing-whitespace t)
 #+END_SRC
 
 ** shrink-whitespace