unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* theme and a question about creating them
@ 2010-12-31 15:52 Dirk-Jan C. Binnema
  2011-01-02 14:16 ` Chong Yidong
  0 siblings, 1 reply; 16+ messages in thread
From: Dirk-Jan C. Binnema @ 2010-12-31 15:52 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1130 bytes --]

Hi all,

Find attached a theme inspired by zenburn-theme[1]; it's only the things I
could generate with the nice GNU Emacs Theme Creator. To adapt the complete
theme (which was written for color-theme.el) to the new system, it'd be nice
if some abstraction were possible i.e., define a handful of base colors, and
re-use them; the original zenburn-theme is /huge/, so it's a bit cumbersome to
work with literals everywhere.

I tried to use defvar/defconst and :inherit do this (as the old theme did),
but it does not seem to work in the new system, i.e.. I tried something like:

(defconst mycolor "#123456")
(deftheme mytheme)
(custom-theme-set-faces 'mytheme
     `(default ((t (:background ,mycolor))))) 

but it seems the defconst is not picked up. And for :inherit, it seems you
cannot refer to the faces defined in the same 'custom-theme-set-faces' form.
I could define theme elsewhere of course, but obviously it'd be nice if my
theme file would be self-contained.

Is there some way to use constants like this, either with defconst/defvar
or :inherit?

Thanks,
Dirk.

[1] http://www.emacswiki.org/emacs/ColorThemeZenburn


[-- Attachment #2: zenburn-theme.el --]
[-- Type: text/plain, Size: 2338 bytes --]

;;; zenburn-theme.el --- Custom face theme for Emacs

;; Copyright (C) 2010 Dirk-Jan C. Binnema.

;; This file is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.

;;; Code:

(deftheme zenburn
  "Based on the Zenburn theme.")

(custom-theme-set-faces
 'zenburn
 '(default ((t (:background "#3f3f3f" :foreground "#dcdccc"))))
 '(cursor ((t (:background "#e0cf9f" :foreground "#ffffff"))))
 '(region ((t (:background "#5f5f5f"))))
 '(mode-line ((t (:background "#1e2320" :foreground "#acbc90"))))
 '(mode-line-inactive ((t (:background "#2e3330" :foreground "#88b090"))))
 '(fringe ((t (:background "#464646"))))
 '(minibuffer-prompt ((t (:foreground "#e0cf9f" :weight bold))))
 '(font-lock-builtin-face ((t (:foreground "#8cd0d3" :weight bold))))
 '(font-lock-comment-face ((t (:slant italic :foreground "#999999"))))
 '(font-lock-constant-face ((t (:foreground "#dca3a3" :weight bold))))
 '(font-lock-function-name-face ((t (:foreground "#8cd0d3"))))
 '(font-lock-keyword-face ((t (:foreground "#e0cf9f" :weight bold))))
 '(font-lock-string-face ((t (:foreground "#cc9393"))))
 '(font-lock-type-face ((t (:foreground "#dfdfbf" :weight bold))))
 '(font-lock-variable-name-face ((t (:foreground "#e0cf9f"))))
 '(font-lock-warning-face ((t (:background "#332323" :foreground "#e37170" :weight bold))))
 '(isearch ((t (:background "#506070" :weight bold))))
 '(lazy-highlight ((t (:background "#1e2320"))))
 '(link ((t (:foreground "#e0cf9f" :underline t))))
 '(link-visited ((t (:foreground "#dfaf8f" :underline t))))
 '(button ((t (:background "#506070" :foreground "#e0cf9f" :weight bold))))
 '(header-line ((t (:background "#2e3330" :foreground "#88b090")))))

(provide-theme 'zenburn)

;; Local Variables:
;; no-byte-compile: t
;; End:

;;; zenburn-theme.el  ends here

[-- Attachment #3: Type: text/plain, Size: 170 bytes --]


-- 
Dirk-Jan C. Binnema                  Helsinki, Finland
e:djcb@djcbsoftware.nl           w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2011-01-20 15:46 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-31 15:52 theme and a question about creating them Dirk-Jan C. Binnema
2011-01-02 14:16 ` Chong Yidong
2011-01-02 17:38   ` Yavuz
2011-01-05 19:26   ` Dirk-Jan C. Binnema
2011-01-05 21:05   ` Stefan Monnier
2011-01-05 22:30     ` Johan Bockgård
2011-01-07  3:36       ` Stefan Monnier
2011-01-08  3:12         ` Johan Bockgård
2011-01-08  5:26           ` Stefan Monnier
2011-01-11 18:57             ` Johan Bockgård
2011-01-06  0:49     ` Chong Yidong
2011-01-08 19:28     ` Chong Yidong
2011-01-15  0:48       ` Johan Bockgård
2011-01-19 22:42         ` Johan Bockgård
2011-01-20  3:04           ` Chong Yidong
2011-01-20 15:46             ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).