In programming files, I use whitespace-mode to highlight the tab and long lines. The default highlighting is too garnish for me.I just want to highlight them with a gray background and keep whatever normal color it should be for the font. How could I set that?
The following setup does not work. I'd like the code beyond 80 columns appearing yellowish, as the characters inside 80 columns in the snapshot.
;; face for long lines' tails
(set-face-attribute 'whitespace-line nil
:background "#555"
:weight 'bold)
;; face for Tabs
(set-face-attribute 'whitespace-tab nil
:background "#555"
:weight 'bold)
set-face-attribute
changes only the attributes you specify.
Set :foreground
to nil
:
(set-face-attribute 'whitespace-line nil
:foreground nil
:background "#555"
:weight 'bold)
For me the unpleasant color turned out to be trailing-whitespace and I'm using this:
;; whitepace looks rediculous in color themes.
(defadvice color-theme-install (after my-color-theme-install-after activate)
"Fix trailing-whitespace after color theme destroys it"
(set-face-attribute 'trailing-whitespace nil
:foreground 'unspecified
:inverse-video 'unspecified
:slant 'unspecified
:weight 'unspecified
:background "#fff"))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With