sellout / emacs-color-theme-solarized

Emacs highlighting using Ethan Schoonover’s Solarized color scheme
http://ethanschoonover.com/solarized
MIT License
1.15k stars 201 forks source link

Emacsclient -c can not start #58

Closed favadi closed 9 years ago

favadi commented 12 years ago

After commit 6948f4f8b7, I cannot use emacsclient properly.

When I run emacsclient -c, I get

Waiting for Emacs...
*ERROR*: Wrong type argument: stringp, nil

But everything run well with emacsclient -t.

In my init.el.

;; Color theme
(add-to-list 'load-path "~/.emacs.d/themes/solarized/")
(require 'color-theme)
(require 'color-theme-solarized)
(color-theme-solarized-dark)
(add-hook 'after-make-frame-functions
          '(lambda (f)
             (with-selected-frame f
               (when (window-system f) (color-theme-solarized-dark)))))

My emacs version is 23.4.1.

Update:

I add these lines in my init.el.

(setq debug-on-error t)

And I still get

*ERROR*: Wrong type argument: stringp, nil

Nothing more or less.

And if I start emacs normally (not with daemon-client) and run server-start, then emacsclient run well. If you need more information, please let me know.

fvides commented 12 years ago

I have observed exactly the same problem. I have emacs 23.3+1-1ubuntu9, bundle with ubuntu 12.04. It works fine with emacs, and emacsclient on the terminal, but fails as described with graphical emacsclient

carljm commented 12 years ago

Same problem here as well :/

london111 commented 12 years ago

Same problem as well

london111 commented 12 years ago

Is there any workaround for this?

peterhoeg commented 11 years ago

I had the same problem, but https://github.com/bbatsov/solarized-emacs works for me - this is assuming you are using emacs 24.

ghost commented 11 years ago

(GNU Emacs 23.2.1) I have the same problem (last commit) :

$ emacsclient.emacs23 -c ~/.emacs Waiting for Emacs... ERROR: Wrong type argument: stringp, nil

And I can't get the bbatsov version working with emacs23 ...

dsheets commented 11 years ago

I believe this problem is caused by (display-color-cells) returning 0 when executed from a .emacs configuration in an emacs --daemon. Do you observe this behavior when you M-x server-start from a running, graphical emacs frame?

If that works for you, great!

Another solution is to replace all (display-color-cells) invocations with (display-color-cells (getenv "DISPLAY")). Unfortunately, this will make switching emacsclient between -c (create new frame) and -nw brittle but I believe it does work if you only care about the graphical display and perhaps that solution will satisfy you.

Finally, I opted to move to Debian sid, install emacs 24, and use bbatsov/solarized-emacs as suggested by @peterhoeg which works great.

I did try to use the emacs24 theme with after-make-frame-functions but it didn't work.

Hope this helps.

sellout commented 9 years ago

This problem no longer exists in the current version as we never call (display-color-cells) directly any more.