From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: CHENG Gao Newsgroups: gmane.emacs.devel Subject: Re: Color themes Date: Mon, 10 Aug 2009 01:28:20 +0800 Organization: cyberhut.org Message-ID: References: <87d47hoox5.fsf@stupidchicken.com> <200907302221.n6UMLUWZ009001@godzilla.ics.uci.edu> <4A722F7B.20101@harpegolden.net> <87d47hisbq.fsf@cyd.mit.edu> <87zlahrggt.fsf@cyd.mit.edu> <87tz0pg1uk.fsf@mail.jurta.org> <4A76481C.6000602@harpegolden.net> <87hbwp32ep.fsf@catnip.gol.com> <432BC810AC84409882C7E7FB5183D8DD@us.oracle.com> <8763d516ox.fsf@mail.jurta.org> <874osim3df.fsf_-_@mail.jurta.org> <87d475lmc1.fsf@cyd.mit.edu> <874oshx8p2.fsf@cyd.mit.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1249839802 7917 80.91.229.12 (9 Aug 2009 17:43:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 9 Aug 2009 17:43:22 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 09 19:43:16 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MaCQN-0006su-Vl for ged-emacs-devel@m.gmane.org; Sun, 09 Aug 2009 19:43:16 +0200 Original-Received: from localhost ([127.0.0.1]:59053 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MaCQN-0001xD-G1 for ged-emacs-devel@m.gmane.org; Sun, 09 Aug 2009 13:43:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MaCP6-0001OM-8F for emacs-devel@gnu.org; Sun, 09 Aug 2009 13:41:56 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MaCP1-0001KK-En for emacs-devel@gnu.org; Sun, 09 Aug 2009 13:41:55 -0400 Original-Received: from [199.232.76.173] (port=38313 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MaCP1-0001K2-3t for emacs-devel@gnu.org; Sun, 09 Aug 2009 13:41:51 -0400 Original-Received: from main.gmane.org ([80.91.229.2]:36605 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MaCP0-0008Vl-Bg for emacs-devel@gnu.org; Sun, 09 Aug 2009 13:41:50 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MaCOw-0001Ke-Tf for emacs-devel@gnu.org; Sun, 09 Aug 2009 17:41:47 +0000 Original-Received: from 58.213.33.224 ([58.213.33.224]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 09 Aug 2009 17:41:46 +0000 Original-Received: from chenggao by 58.213.33.224 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 09 Aug 2009 17:41:46 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 63 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 58.213.33.224 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (darwin) Cancel-Lock: sha1:jQZ+0AAOZVASInAxg0IBIVcev9c= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:113860 Archived-At: *On Sun, 09 Aug 2009 12:18:01 -0400 * Also sprach Chong Yidong : > Leo writes: > >> I also don't like color-theme, in particular, how the themes are created >> by re-defining all faces. A comprehensive theme could easily run up to a >> few thousand lines and it still does not offer 100% coverage, let alone >> consistency. >> >> Perhaps a color theme should be defined to be something like a palette >> and when a palette is selected defface is forced to only use colors in >> it. > > This is exactly the kind of problem that Custom themes is intended to > solve. The code for *creating* custom themes is still a little buggy, > but the code for *using* it should work, and we ought to be able to make > use of it to set color themes. > > Here's an example. Create a file called forest-theme.el, with the > contents shown below, and put it in .emacs.d. Then do M-x enable-theme > RET forest RET, or customize custom-enabled-themes and add `forest' to > the list. > > So if we want to use this mechanism to implement color themes, it's just > a matter of adding some *-theme.el files to the load path, and adding a > command to add that theme to custom-enabled-themes. > > As you can see, (i) your existing face customizations, if any, will > override the color theme, as they should, and (ii) it doesn't take a lot > of code to define a color theme using this method. > > > ======= start forest-theme.el ============ > > (deftheme forest > "Created 2009-08-09.") > > (custom-theme-set-faces > 'forest > '(default ((t (:foreground "wheat" :background "black")))) > '(font-lock-comment-face ((((class color) (min-colors 88)) (:foreground "medium sea green")))) > '(font-lock-constant-face ((((class color) (min-colors 88)) (:foreground "turquoise")))) > '(font-lock-function-name-face ((((class color) (min-colors 88)) (:foreground "pale green")))) > '(font-lock-keyword-face ((((class color) (min-colors 88)) (:foreground "white")))) > '(font-lock-string-face ((((class color) (min-colors 88)) (:foreground "dark khaki")))) > '(font-lock-type-face ((((class color) (min-colors 88)) (:foreground "medium aquamarine")))) > '(font-lock-variable-name-face ((((class color) (min-colors 88)) (:foreground "yellow green")))) > '(font-lock-warning-face ((((class color) (min-colors 88)) (:foreground "salmon1")))) > '(font-lock-builtin-face ((((class color) (min-colors 88)) (:foreground "LightSteelBlue")))) > '(region ((((class color) (min-colors 88)) (:foreground "white" :background "dark green")))) > '(highlight ((((class color) (min-colors 88)) (:foreground "white" :background "dark green"))))) > > (provide-theme 'forest) > > ======= end forest-theme.el ============ I must say I like this way very much. I just tested your theme, and it works, though not super gorgeous :-P -- Volo, non valeo