* Different emacs24 deftheme for emacsclient -t/-c frames
@ 2012-02-20 15:42 Maik Beckmann
2012-02-20 19:22 ` suvayu ali
2012-02-20 21:50 ` Maik Beckmann
0 siblings, 2 replies; 3+ messages in thread
From: Maik Beckmann @ 2012-02-20 15:42 UTC (permalink / raw)
To: help-gnu-emacs
Hello
I like to use a different theme depending on whether I connect to the running
server with a terminal frame
% emacsclient -t
or with a gtk frame
% emacsclient -c
The code I've used for color-theme.el looks like this
(require 'color-theme)
(setq color-theme-is-cumulative nil)
(defun mb/pick-color-theme (frame)
(select-frame frame)
(let ((color-theme-is-global nil))
(if (window-system frame)
(color-theme-vim-colors)
(color-theme-pok-wob))))
(add-hook 'after-make-frame-functions 'mb/pick-color-theme)
;; For when started with emacs or emacs -nw rather than emacs --daemon
(let ((color-theme-is-global nil))
(color-theme-initialize)
(if window-system
(eval-after-load "color-theme"
'(color-theme-vim-colors))
(color-theme-pok-wob)))
Here the result
- [http://i.imgur.com/2nD17.png]
My question: How does the code look like that does the same for emacs24
deftheme themes?
Here a try
;; 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))
The result
- [http://i.imgur.com/FocGA.png]
shows when happens if a terminal client is connected after a gtk frame client.
The exisiting gtk frame got affected by (enable-theme 'tango-dark).
Comparing the two code snippets brings up the question: Is there an equivalent
to color-theme-is-global for deftheme themes? If not, how is the proper way of
doing it?
Thanks,
Maik
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-02-20 21:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-20 15:42 Different emacs24 deftheme for emacsclient -t/-c frames Maik Beckmann
2012-02-20 19:22 ` suvayu ali
2012-02-20 21:50 ` Maik Beckmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).