9

Related: Emacs: GUI with emacs --daemon not loading fonts correctly

My init.el contains the following lines:

(require 'darktooth-theme)
(load-theme 'darktooth t)

If I start Emacs with

$ emacs

... the theme loads properly. [Scroll down!]

The Darktooth theme working properly on Emacs.

However, if I start Emacs with

$ emacs --daemon
   ...
$ emacsclient -c

... the theme doesn't load properly. [Keep scrolling]

The Darktooth theme not working.

Why does this happen, and how can it be fixed?

digitalis_
  • 427
  • 4
  • 10

1 Answers1

4

Edit: This question has several answers, which generally seem to boil down to "use after-frame-functions".


Original answer:

I think you want to call load-theme from after-init-hook. That's where I load my own theme, and I have no problems using it with emacsclient.

I don't know the ins and outs of the Emacs initialization process well enough to say for sure, but presumably you're loading the theme too early, and it's getting overriden by other settings (maybe something set up through customize?).

Aaron Harris
  • 2,664
  • 17
  • 22
  • 1
    Hmm... I tried it, and it didn't work for me. I'm pretty sure the problem is something to do with the Emacs server not liking GUI settings (because the theme loads in the normal Emacs gui). – digitalis_ Jul 25 '16 at 19:03
  • 2
    After a bit of googling, I came across [this question](http://stackoverflow.com/q/18904529/5030424), which has several purported solutions. Maybe one of them will work? No idea why my setup won't work for you. – Aaron Harris Jul 25 '16 at 20:36
  • That works! Thanks for the digging.... It is strange, though, isn't it? Perhaps you should edit your answer and put that link in at the top. – digitalis_ Jul 26 '16 at 13:22