Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

Thanks.

share|improve this question
add comment

1 Answer

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)
        (progn  
          (disable-theme 'tango-dark) ; in case it was active
          (enable-theme 'tango))
      (progn  
        (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
1  
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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