Search code examples
emacsemacs24

How to show dots for whitespaces in Emacs 24.5?


I wonder, isn't there a simple way to show dots for whitespaces in Emacs 24.5? I've tried to find information and and have always found some complex solutions which worked for some people and didn't for others. Isn't there a de-facto and easy way?


Solution

  • Use whitespace-mode, or even global-whitespace-mode to see them in all buffers. If you only want to see spaces, configure it with the following:

    (setq whitespace-style '(space-mark))
    (setq whitespace-display-mappings '((space-mark 32 [183] [46])))
    

    Or, if you want a different colour for the dots, include also

    (setq whitespace-space 'your-favourite-whitespace-face) ; <- insert the face
    (setq whitespace-style '(face spaces space-mark))
    

    You can customize the settings rather then set the values manually.