Advertisement
Guest User

emacs-theme-switcher

a guest
Mar 10th, 2013
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 2.42 KB | None | 0 0
  1. (if (>= emacs-major-version 24)
  2.   (progn
  3.  
  4.     (add-to-list 'custom-theme-load-path "~/.emacs.d/themes")
  5.  
  6.     (setq my-color-themes (list
  7.                'cyberpunk
  8.                    'zenburn
  9.                    'solarized-dark
  10.                'solarized-light
  11.                'comidia
  12.                'late-night
  13.                    ;; 'MechanicalTurq
  14.                    ;; 'DeepBlueDay
  15.                'tango-dark
  16.                    ))
  17.  
  18.     (defun my-theme-set-default ()
  19.       (interactive)
  20.       (setq theme-current my-color-themes)
  21.       (load-theme (car theme-current) t)
  22.       ;; (set-default-font font-default) ;; restore default font
  23.       )
  24.     ;; TODO: add reverse funcitonnality
  25.     (defun my-theme-cycle ()
  26.       (interactive)
  27.       (disable-theme (car theme-current))
  28.       (setq theme-current (cdr theme-current))
  29.       (if (null theme-current)
  30.           (setq theme-current my-color-themes))
  31.       (load-theme (car theme-current) t)
  32.       ;; (set-default-font font-default) ;; restore default font
  33.       )
  34.  
  35.       (my-theme-set-default)
  36.       (global-set-key [f12] 'my-theme-cycle)
  37.     )
  38.   ;; else
  39.   (progn
  40.       (require 'color-theme)
  41.       ;; (require 'color-theme-solarized) ;; doesn't work w/ emacsclient 23 on linux
  42.       (setq my-color-themes (list
  43.                  ;; 'color-theme-solarized-light
  44.                  ;; 'color-theme-solarized-dark
  45.                  'color-theme-comidia
  46.                  ;;             'color-theme-midnight
  47.                  'color-theme-aalto-light
  48.                  'color-theme-late-night
  49.                  ;;             'color-theme-kingsajz
  50.                  ;;             'color-theme-simple-1
  51.                  ))
  52.       (setq fav-color-themes-d (list 'color-theme-comidia
  53.                      'color-theme-late-night
  54.                      'color-theme-simple-1
  55.                      'color-theme-midnight
  56.                      'color-theme-hober
  57.                      ))
  58.       (setq fav-color-themes-l (list 'color-theme-aalto-light
  59.                      'color-theme-kingsajz
  60.                      ))
  61.       (defun my-theme-set-default ()
  62.     (interactive)
  63.     (setq theme-current my-color-themes)
  64.     (funcall (car theme-current)))
  65.       (defun my-theme-cycle ()
  66.     (interactive)
  67.     (setq theme-current (cdr theme-current))
  68.     (if (null theme-current)
  69.         (setq theme-current my-color-themes))
  70.     (funcall (car theme-current))
  71.     (message "%S" (car theme-current)))
  72.  
  73.       (setq theme-current my-color-themes)
  74.       (eval-after-load "color-theme"
  75.     '(progn
  76.        (color-theme-initialize)
  77.        (my-theme-set-default)))
  78.       (setq
  79.        color-theme-is-global   t
  80.        color-theme-is-cumulative t)
  81.       (global-set-key [f12] 'my-theme-cycle)
  82.       )
  83.   )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement