Is there a way to define a face in Emacs (e.g. highlight, e.g. hl-line ) so that it only changes the background color (and Emacs uses the foreground color as if the word were not highlighted).
In particular, I tried the following in the theme of tango-dark
(custom-set-faces '(region ((t (:inherit nil :background "RoyalBlue4")))) '(highlight ((t (:inherit region :background "dark olive green")))) '(hl-line ((t (:inherit highlight)))))
and, as can be seen below, the selection of the area does in relation to the foreground font (i.e. only changes the background color):

, but highlighting the current line does't:

Why? and how can i get the same effect using hl-line ?
Update:
This seems like a bug in the tango-dark theme (Emacs built-in theme). The code works well with the default theme (which is loaded using emacs -Q ). I posted this on the official error mailing list.
source share