Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

different custom theme (NOT color theme) per emacs frame?

Tags:

emacs

elisp

I am trying to get Emacs (v24.3.1) to load a new custom theme in created frames. That is, I have my default theme in my initial frame, and all subsequent frames should get a separate theme (allowing me to easily identify the initial frame).

Here is what I have so far:

;make new frames use a different custom theme
(defun apply-custom-theme (frame)
  "Apply custom theme to a frame based on whether its a 'real'
   window or a console window."
  (select-frame frame)
  (if (window-system frame)
      (load-theme 'light-blue t)
    (load-theme 'tango-black t)))
(add-hook 'after-make-frame-functions 'apply-custom-theme)

This works, except that the theme loaded affects ALL frames, including the initial one. [I am aware that even without my hook, 'load-theme' in one frame will affect all frames.]

I know I can achieve this goal with the older color-theme facility ... I'm curious to see if it can also be done with Emacs 24x custom themes (which would permit easy creation and customization of new themes, among other things).

like image 394
troyfolger Avatar asked Feb 12 '15 16:02

troyfolger


1 Answers

I don't think the custom-theme support can do frame-specific themes, currently. It can probably support (with a bit of extra coding) using different themes for different kinds of frames (e.g. one theme for tty and another for X11), tho.

I suggest you M-x report-emacs-bug requesting a new (set of) feature(s) for that kind of situation.

like image 185
Stefan Avatar answered Oct 26 '22 02:10

Stefan