[Emacs] Add text-mode-hook for show-trailing-whitespace

This commit is contained in:
Ivan Malison 2017-02-28 20:24:48 -08:00
parent 0027d5fb86
commit 9048206704
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8

View File

@ -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