From 8a2b251810f31e6fe4caf1217d3647a32fceb905 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 27 Apr 2017 11:58:39 +0200 Subject: Emacs: Use built-in trailing whitespace instead of ws-butler --- emacs/.emacs.d/init.org | 22 +++++++++++----------- 1 file 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 -- cgit 1.4.1