I'm trying to achieve the following behavior in Emacs24:
I like to use a different theme (solarized-dark vs. solarized-light) depending on whether I connect to the running server with a terminal frame
% emacsclient -t
or with a gtk frame
% emacsclient -c
This seems to have worked in older Emacs, but the current Emacs I couldn't find a way. I alreday checked SO (e.g., https://stackoverflow.com/q/18904529/152439 and answers) and the mailing lists (e.g., https://lists.gnu.org/archive/html/help-gnu-emacs/2012-02/msg00227.html and https://lists.gnu.org/archive/html/help-gnu-emacs/2012-02/msg00237.html).
My current setup looks like this:
(add-to-list 'custom-theme-load-path "~/.emacs.d/themes/solarized")
(if (daemonp)
(add-hook 'after-make-frame-functions
(lambda (frame)
(select-frame frame)
(if (display-graphic-p frame)
(load-theme 'solarized-light t)
(load-theme 'solarized-dark t)
)
)
)
(load-theme 'solarized-light t)
)
The problem with this is that if I have a graphical frame open and then open a terminal frame with emacsclient -t
, the theme solarized-dark gets applied to both the new terminal frame (which is correct) and the already open graphical frame (which should be left untouched, ideally). The equivalent happens when a terminal frame is already open and I open a new graphical frame with emacsclient -c
.
EDIT: In case this is not possible with current Emacs24, are there any plans to make it possible again?
color-theme.el
which IIRC had frame dependent color settings. There is no great advantage in using the inbuilt theming capabilities apart from ubiquity.color-theme
and the Emacs 24 theme systems. My version of the solarized theme also supports both systems, if you decide to go this route.