3

I get an error, Invalid face: helm-selection, using dotspacemacs/user-config:

(set-face-background 'helm-selection "#EEAD0E")

It runs fine if I manually enter it using helm-M-x.

However, I get no errors (during startup) for the following in dotspacemacs/user-config:

 (custom-set-faces
    '(helm-selection ((t (:background "#EEAD0E" :foreground "#222226"))))
  )

I've read the documentation on both face functions, but I still counldn't figure out the reason for the different behaviour.

1

Seems pretty clear: helm-M-x must cause face helm-selection to be defined. Otherwise, it is not defined by default.

The error message tells you that symbol `helm-selection' is not associated with a face.

If you had tried just (set-face-background 'highlight "#EEAD0E") you would have seen that there is no problem, because face highlight is predefined. Your problem is that nothing has defined face helm-selection.

The reason you don't see a problem with custom-set-faces is that it does not require the face to be defined ahead of time. It just applies of face specs (specifications that are lists) to the user theme. It does not try to change, itself, an existing face.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.