Monday, March 3, 2008

Emacs Tip #12: show-trailing-whitespace

If you don't like having lines of code/text with whitespace at the
ends, you can turn on the variable 'show-trailing-whitespace' to have
Emacs highlight the offending whitespace.

When set, the variable's value becomes buffer local, so set it to true
in the mode-hooks for your preferred modes. Or, if you want it on all
the time, change the default value with:


(setq-default show-trailing-whitespace t)

2 comments:

Clint Laskowski said...

Hmmm. I can't get this to work. I tried M-x show-trailing-whitespace and (setq-default show-trailing-whitespace t) and then C-x C-e.

Clint Laskowski said...

Update: I got it to work ... must have had something to do with my color theme.