2

I'm trying to set helm using use-package. The set-face-atttribute doesn't work within use-package:

(use-package helm-config
      :config
      (progn
        (helm-mode 1)
        ;; other config ...
        (set-face-attribute 'helm-selection nil 
                    :background "purple"
                    :foreground "black")))

However, it works well outside the use-package. It is quite neat to put all the config of a specific package together. So how to set face in use-package?

  • 1
    Can you specify how it does not work within use-package? – Matthias Jan 7 '15 at 13:00
1

Worked for me like this:

(use-package helm
  :ensure t
  :init
  (progn
    (require 'helm-config)
    (helm-mode 1)
    (set-face-attribute 'helm-selection nil
            :background "purple"
            :foreground "black")))
  • I tested it for several times before I find out the problem: I put helm config (using use-package) in a separate file, and load it in the init.el. This doesn't work. I have to put the use-package to the init.el file. Is there anything I can do if I don't want to put everyting in the init.el? load is not the right option? – Nick Jan 7 '15 at 13:35
  • 1
    You ask the wrong person. I have adopted the approach from metasandwich.com/2013/01/19/emacs-config-youre-doing-it-wrong and put everyting in one file. Then i imenu through the different sections using helm imenu. I feel very comfortable with this approach. – Matthias Jan 7 '15 at 15:49
  • If you want to improve your emacs startup time by lazy-loading helm, you should change :init to :config and then add a :bind section with a few keys you're most likely to use (I bind C-x C-f and M-x and a few others). helm is one of the slowest packages for startup, lazy-loading it can have a big impact. – robru Jan 11 '15 at 7:46

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.