lotsa changes and inclusion of elpy
[emacs.git] / .emacs.d / elisp / emacs-color-theme-solarized / color-theme-solarized.el
1 ;;; Author: Ethan Schoonover, Solarized; Greg Pfeil, Emacs adaptation
2 ;;; URL: http://ethanschoonover.com/solarized
3
4 ;;; This file is not (YET) part of GNU Emacs.
5
6 ;;; # Usage
7
8 ;;; 1. Install the color-theme package
9 ;;; (http://www.emacswiki.org/cgi-bin/wiki/ColorTheme)
10 ;;; 2. Load this file
11 ;;; 3. M-x color-theme-solarized-[dark|light]
12
13 (let ((current-file-name (or load-file-name buffer-file-name)))
14 (if current-file-name
15 (let* ((reqname (concat (file-name-directory current-file-name)
16 "solarized-definitions.el"))
17 (compreqname (concat reqname "c")))
18 (require 'solarized-definitions
19 (if (file-exists-p compreqname) compreqname reqname)))
20 (require 'solarized-definitions)))
21
22 (eval-when-compile
23 (require 'color-theme))
24
25 ;;;###autoload
26 (defun color-theme-solarized (mode)
27 "Color theme by Ethan Schoonover, created 2011-03-24.
28 Ported to Emacs by Greg Pfeil, http://ethanschoonover.com/solarized."
29 (interactive "Slight or dark? ")
30 (color-theme-install
31 (let* ((definitions (solarized-color-definitions mode))
32 (faces (first definitions))
33 (variables (second definitions)))
34 (solarized-color-definitions mode)
35 `(,(intern (concat "color-theme-solarized-" (symbol-name mode)))
36 ,variables
37 ,@faces))))
38
39 ;;;###autoload
40 (defun color-theme-solarized-dark ()
41 (interactive)
42 (color-theme-solarized 'dark))
43
44 ;;;###autoload
45 (defun color-theme-solarized-light ()
46 (interactive)
47 (color-theme-solarized 'light))
48
49 (add-to-list 'color-themes
50 `(color-theme-solarized-light
51 "Solarized Light"
52 ,solarized-description))
53 (add-to-list 'color-themes
54 `(color-theme-solarized-dark
55 "Solarized Dark"
56 ,solarized-description))
57
58 (provide 'color-theme-solarized)