Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Sometimes I use emacsclient -t -a '' in xterm, and sometimes I use emacsclient -c as a GUI application. What annoys me is that the font settings and color-theme are initialized when emacs server starts up so the window-system test doesn't take effect.

So are there any functions that I can make use of to let the emacsclient choose the face settings?


share|improve this question

try to follow this post, they are talking about a similar issue.

here are the snippets from the post (I didnt try it myself though):

  ;; last t is for NO-ENABLE
  (load-theme 'tango t t)
  (load-theme 'tango-dark t t)

  (defun mb/pick-color-theme (frame)
    (select-frame frame)
    (if (window-system frame)
          (disable-theme 'tango-dark) ; in case it was active
          (enable-theme 'tango))
        (disable-theme 'tango) ; in case it was active
        (enable-theme 'tango-dark))))
  (add-hook 'after-make-frame-functions 'mb/pick-color-theme)

  ;; For when started with emacs or emacs -nw rather than emacs --daemon
  (if window-system
      (enable-theme 'tango)
    (enable-theme 'tango-dark))

if all goes well, it should look like: this

share|improve this answer
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – gronostaj May 27 '13 at 11:15
you are right, i included the important parts in this post. – Shlomi May 27 '13 at 12:57
The frame-local theme settings seem difficult. But at least it works partially for my problem. Thanks. – Hongxu Chen May 28 '13 at 12:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .