Skip to content

Commit addd445

Browse files
committed
Eliminate create-solarized-theme macro
This was a remnant from having separate solarized-dark and -light themes. We only ever produce one theme now, so use the usual theme definition mechanism.
1 parent 0719992 commit addd445

File tree

2 files changed

+21
-28
lines changed

2 files changed

+21
-28
lines changed

solarized-definitions.el

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -823,29 +823,5 @@ contains Solarized symbols."
823823
;; haskell
824824
(haskell-keyword-face (,@fg-cyan)))))))
825825

826-
;;;###autoload
827-
(when (boundp 'custom-theme-load-path)
828-
(add-to-list 'custom-theme-load-path
829-
(file-name-as-directory (file-name-directory load-file-name))))
830-
831-
(defmacro create-solarized-theme (name description color-definitions)
832-
"Define the theme from the provided pieces.
833-
NAME is a bare symbol, DESCRIPTION is the text that will be presented to users,
834-
and COLOR-DEFINITIONS is the list of face-specs that comprise the theme."
835-
`(let ((name ,name)
836-
(description ,description)
837-
(color-definitions ,color-definitions))
838-
(custom-declare-theme name (custom-make-theme-feature name) description)
839-
(apply #'custom-theme-set-faces name color-definitions)
840-
(custom-theme-set-variables
841-
name
842-
;; This is obsolete, but something might still be referencing it.
843-
'(ansi-color-names-vector
844-
,(apply #'vector
845-
(mapcar (lambda (color-name)
846-
(nth 1 (assoc color-name solarized-colors)))
847-
'(base02 red green yellow blue magenta cyan base2)))))
848-
(provide-theme name)))
849-
850826
(provide 'solarized-definitions)
851827
;;; solarized-definitions.el ends here

solarized-theme.el

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
1-
;; -*- lexical-binding: t; -*-
1+
;; solarized-theme.el --- Solarized custom theme -*- lexical-binding: t; -*-
22

33
(require 'solarized-definitions
44
(locate-file "solarized-definitions.el" custom-theme-load-path
55
'("c" "")))
66

7-
(create-solarized-theme 'solarized
8-
solarized-description
9-
(solarized-color-definitions))
7+
(deftheme solarized solarized-description)
8+
9+
(apply #'custom-theme-set-faces 'solarized (solarized-color-definitions))
10+
11+
(custom-theme-set-variables
12+
'solarized
13+
;; This is obsolete, but something might still be referencing it.
14+
`(ansi-color-names-vector
15+
,(apply #'vector
16+
(mapcar (lambda (color-name)
17+
(nth 1 (assoc color-name solarized-colors)))
18+
'(base02 red green yellow blue magenta cyan base2)))))
1019

1120
(cl-defun solarized-update-background-mode
1221
(appearance &optional (frames (frame-list)))
@@ -31,3 +40,11 @@ that observes the background characteristic."
3140
('dark 'light)
3241
(_ 'dark))))
3342
(solarized-update-background-mode new-mode)))
43+
44+
;;;###autoload
45+
(when load-file-name
46+
(add-to-list 'custom-theme-load-path
47+
(file-name-as-directory (file-name-directory load-file-name))))
48+
49+
(provide-theme 'solarized)
50+
;;; solarized-theme.el ends here

0 commit comments

Comments
 (0)