47
|
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 |
(require 'solarized-definitions |
|
14 |
(let* ((reqname (concat (file-name-directory (or load-file-name |
|
15 |
buffer-file-name)) |
|
16 |
"solarized-definitions.el")) |
|
17 |
(compreqname (concat reqname "c"))) |
|
18 |
(if (file-exists-p compreqname) compreqname reqname))) |
|
19 |
|
|
20 |
(eval-when-compile |
|
21 |
(require 'color-theme)) |
|
22 |
|
|
23 |
;;;###autoload |
|
24 |
(defun color-theme-solarized (mode) |
|
25 |
"Color theme by Ethan Schoonover, created 2011-03-24. |
|
26 |
Ported to Emacs by Greg Pfeil, http://ethanschoonover.com/solarized." |
|
27 |
(interactive "Slight or dark? ") |
|
28 |
(color-theme-install |
|
29 |
(let* ((definitions (solarized-color-definitions mode)) |
|
30 |
(faces (first definitions)) |
|
31 |
(variables (second definitions))) |
|
32 |
(solarized-color-definitions mode) |
|
33 |
`(,(intern (concat "color-theme-solarized-" (symbol-name mode))) |
|
34 |
,variables |
|
35 |
,@faces)))) |
|
36 |
|
|
37 |
;;;###autoload |
|
38 |
(defun color-theme-solarized-dark () |
|
39 |
(interactive) |
|
40 |
(color-theme-solarized 'dark)) |
|
41 |
|
|
42 |
;;;###autoload |
|
43 |
(defun color-theme-solarized-light () |
|
44 |
(interactive) |
|
45 |
(color-theme-solarized 'light)) |
|
46 |
|
|
47 |
(add-to-list 'color-themes |
|
48 |
`(color-theme-solarized-light |
|
49 |
"Solarized Light" |
|
50 |
,solarized-description)) |
|
51 |
(add-to-list 'color-themes |
|
52 |
`(color-theme-solarized-dark |
|
53 |
"Solarized Dark" |
|
54 |
,solarized-description)) |
|
55 |
|
|
56 |
(provide 'color-theme-solarized) |