[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Switching Themes using custom functions

From: G. Martin Butz
Subject: Switching Themes using custom functions
Date: Sun, 10 Nov 2013 12:37:43 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130827 Icedove/17.0.8


as I sometimes want to switch themes and I have several custom colors (e.g. power line colors) I build some functions to do that (badly hacked as my lisp knowledge is close to zero). Here is an example:

      (defun theme-s ()
        "Switch to Solarized-Theme"

  ;; disable current theme
        (defadvice load-theme
          (before theme-dont-propagate activate)
          (mapcar #'disable-theme custom-enabled-themes))
          (load-theme 'solarized-dark t)
        ;; power line (solarized)
        (set-face-attribute 'mode-line nil
                            :background "#586e75"
                            :box nil)
        (set-face-attribute 'mode-line-inactive nil
                            :box nil)
        (setq powerline-color1 "#002b36")
        (setq powerline-color2 "#073642")
        (set-face-background 'region "#839496")
        (set-face-background 'hl-line "#073642")
        (set-face-background 'region "#454545")
        (set-face-background 'fringe "#002b36")
        (set-face-foreground 'fringe "#002b36")
        (setq indicate-buffer-boundaries 'right)
        (setq indicate-empty-lines nil)
        (setq-default cursor-type 'bar)
        (set-cursor-color "#fdf6e3")

This basically works but I wonder why e.g. the region background color is not loaded when using this function. I can eval the function and all works well but if I call the function some of it will be applied and some of it not (especially the region background color).

Any idea what I am doing wrong?


| G. Martin Butz,, 0421 98749324, |

reply via email to

[Prev in Thread] Current Thread [Next in Thread]