Can't apply a color theme to a single frame in Emacs?

My .emacsfile is here . I want the theme to change when I'm in shell-mode. But what happens is that the theme applies to all windows. I set the variable color-theme-is-globalto nil, but the problem still persists.

(add-hook 'shell-mode-hook 'color-theme-monokai-terminal)
(set-variable 'color-theme-is-global nil)

These are the relevant lines in my file .emacs. What to do to make it work?

+3
source share
2 answers

I usually start Emacs as a daemon, and then open frames as needed. I use different color themes for X frames and terminal frames:

(require 'color-theme)
(color-theme-initialize)

(defun apply-color-theme (frame)
  "Apply color theme to a frame based on whether its a 'real'
   window or a console window."
  (select-frame frame)
  (if (window-system frame)
      (color-theme-tango)
    (color-theme-tango-black)))

(setq color-theme-is-global nil)
(add-hook 'after-make-frame-functions 'apply-color-theme)

(if window-system ...) shell- script -mode color-theme-X .

: Emacs , , , , , .

+4

, : emacs-speak frame , window . ( , , , , .., "".) , , C-x 3 ( ), windows, - M-x shell-mode, buffer, .

- ( , , , ) color-theme-is-global , .

, , , - ( , , ):

(defun shell-mode-in-new-frame ()
    (interactive)
    (select-frame (make-frame))
    (color-theme-monokai-terminal)
    (shell-mode))

, .

+3

Source: https://habr.com/ru/post/1749894/


All Articles