src.nth.io/

summaryrefslogtreecommitdiff
path: root/thirdparty/color-theme-solarized/color-theme-solarized.el
blob: e95b7822512097f4d43b6720d2ea0c3c9cb94bd0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
;;; Author: Ethan Schoonover, Solarized; Greg Pfeil, Emacs adaptation
;;; URL: http://ethanschoonover.com/solarized

;;; This file is not (YET) part of GNU Emacs.

;;; # Usage

;;; 1. Install the color-theme package
;;;   (http://www.emacswiki.org/cgi-bin/wiki/ColorTheme)
;;; 2. Load this file
;;; 3. M-x color-theme-solarized-[dark|light]

(require 'solarized-definitions
         (let* ((reqname (concat (file-name-directory (or load-file-name
                                                          buffer-file-name))
                                 "solarized-definitions.el"))
                (compreqname (concat reqname "c")))
           (if (file-exists-p compreqname) compreqname reqname)))

(eval-when-compile
  (require 'color-theme))

;;;###autoload
(defun color-theme-solarized (mode)
  "Color theme by Ethan Schoonover, created 2011-03-24.
Ported to Emacs by Greg Pfeil, http://ethanschoonover.com/solarized."
  (interactive "Slight or dark? ")
  (color-theme-install
   (let* ((definitions (solarized-color-definitions mode))
          (faces (first definitions))
          (variables (second definitions)))
       (solarized-color-definitions mode)
     `(,(intern (concat "color-theme-solarized-" (symbol-name mode)))
       ,variables
       ,@faces))))

;;;###autoload
(defun color-theme-solarized-dark ()
  (interactive)
  (color-theme-solarized 'dark))

;;;###autoload
(defun color-theme-solarized-light ()
  (interactive)
  (color-theme-solarized 'light))

(add-to-list 'color-themes
             `(color-theme-solarized-light
               "Solarized Light"
               ,solarized-description))
(add-to-list 'color-themes
             `(color-theme-solarized-dark
               "Solarized Dark"
               ,solarized-description))

(provide 'color-theme-solarized)