Search code examples
emacsemacs-helm

emacs helm: any way to make it obey the template colors?


Using Helm, I noticed that helm isn't obeying (being compliant with) the theme colors, for example, on file selection?

Any simple way (preferably without messing on the theme file) to make helm comply with the theme colors?

Using emacs26 on linux


Solution

  • Simply...

    If a theme doesn't have a configuration for the face in question, then that face won't be themed. A "face" is basically the term for the collection of properties of a given bit of text. For example, the lisp keyword lambda has the face font-lock-keyword-face. By default this has the property :foreground Purple giving you purple text on the default background. If I use a theme, Solarized for example, font-lock-keyword-face will be set to #859900 a lovely pale-ish green. Thus lambda (and any other bit of text defined as a "keyword") will be that color too.

    Now, if the text you're looking at has the face helm-directory-selection-face for example (I made that face name up. I don't use helm), you'll be out of luck as you can see that Solarized doesn't have a config for for helm-directory-selection-face. At this point you really have two options, 1) change the definition of helm-directory-selection to use a different face or 2) add helm-directory-selection-face to your theme. If you want to do that, put the point (cursor) in the bit of text in question, then do C-u C-x =. This will generate a new *Help* window with all the properties at the point's location. Towards the bottom will be a small table of the text-properties. You'll want to add the value of face to your theme.

    Most active theme authors are happy to take requests via their chosen support mechanism (github, email, etc.), especially if you provide a patch.

    tl;dr

    Just because a theme exists, doesn't mean that everything is themed. Add, the face in question to your theme, or hit up the theme's author, preferably with a patch.