jcubic
jcubic

Reputation: 66610

How to change face of whitespace-tab in whitespace-mode to red background in Emacs

I have this code in my .emacs file:

(setq-default show-trailing-whitespace t)
(setq whitespace-style '(face tabs))
(whitespace-mode)

How can I change the var whitespace-tab so my tabs look the same as trailing whitespace (red background)?

Upvotes: 1

Views: 1005

Answers (2)

jcubic
jcubic

Reputation: 66610

Found it, need to use this code:

(setq whitespace-style '(face tabs))
(setq tab-face (make-face 'tab-face))
(set-face-background 'tab-face "red")
(setq whitespace-tab 'tab-face)
(whitespace-mode)

Upvotes: 2

Drew
Drew

Reputation: 30708

An alternative: do not bother with whitespace-mode for this. Use library highlight-chars.el (see your related question), and just customize face hc-tab (M-x customize-face hc-tab).

Upvotes: 1

Related Questions