From 90482067048265691a5e1b887b20427a58894d7b Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Tue, 28 Feb 2017 20:24:48 -0800 Subject: [PATCH] [Emacs] Add text-mode-hook for show-trailing-whitespace --- dotfiles/emacs.d/README.org | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index 6474d017..f5412f59 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -1306,10 +1306,15 @@ Set the default fill-column #+END_SRC ** Show Trailing Whitespace Trailing whitespace is really messy and annoying, which makes this a must-have -in my opinion. It's kind of crazy how often you will encounter serious codebases -with random whitespace ALL over the place. +in my opinion. It's kind of crazy how often you will encounter serious codebases with random whitespace ALL over the place. #+BEGIN_SRC emacs-lisp -(setq-default show-trailing-whitespace t) +(setq-default show-trailing-whitespace nil) + +(defun imalison:show-trailing-whitespace () + (interactive) + (setq show-trailing-whitespace t)) + +(add-hook 'text-mode-hook 'imalison:show-trailing-whitespace) #+END_SRC *** Disable Unfortunately, this setting can get annoying in a lot of modes, which is why I