From 4b3e541721f52dbfa307e2cab3cd682e25987fdd Mon Sep 17 00:00:00 2001 From: Tianxiang Xiong Date: Mon, 22 Jan 2018 17:07:05 -0800 Subject: Make `zenburn-override-colors-alist` a customizable variable --- zenburn-theme.el | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'zenburn-theme.el') diff --git a/zenburn-theme.el b/zenburn-theme.el index c31f3f2..b6dbcda 100644 --- a/zenburn-theme.el +++ b/zenburn-theme.el @@ -33,6 +33,23 @@ (deftheme zenburn "The Zenburn color theme") +(defgroup zenburn-theme nil + "Zenburn theme." + :prefix "zenburn-theme-" + :link '(url-link :tag "GitHub" "http://github.com/bbatsov/zenburn-emacs") + :tag "Zenburn theme") + +;;;###autoload +(defcustom zenburn-override-colors-alist '() + "Place to override default theme colors. + +You can override a subset of the theme's default colors by +defining them in this alist." + :group 'zenburn-theme + :type '(alist + :key-type (string :tag "Name") + :value-type (string :tag " Hex"))) + ;;; Color Palette (defvar zenburn-default-colors-alist @@ -78,16 +95,6 @@ Each element has the form (NAME . HEX). `+N' suffixes indicate a color is lighter. `-N' suffixes indicate a color is darker.") -(defvar zenburn-override-colors-alist - '() - "Place to override default theme colors. - -You can override a subset of the theme's default colors by -defining them in this alist before loading the theme.") - -(defvar zenburn-colors-alist - (append zenburn-default-colors-alist zenburn-override-colors-alist)) - (defmacro zenburn-with-color-variables (&rest body) "`let' bind all colors defined in `zenburn-colors-alist' around BODY. Also bind `class' to ((class color) (min-colors 89))." @@ -95,7 +102,8 @@ Also bind `class' to ((class color) (min-colors 89))." `(let ((class '((class color) (min-colors 89))) ,@(mapcar (lambda (cons) (list (intern (car cons)) (cdr cons))) - zenburn-colors-alist)) + (append zenburn-default-colors-alist + zenburn-override-colors-alist))) ,@body)) ;;; Theme Faces -- cgit v1.2.3