From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: Color themes Date: Sun, 09 Aug 2009 12:18:01 -0400 Message-ID: <874oshx8p2.fsf@cyd.mit.edu> 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> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1249834652 19271 80.91.229.12 (9 Aug 2009 16:17:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 9 Aug 2009 16:17:32 +0000 (UTC) Cc: 'David De La Harpe Golden' , 'Lennart Borgman' , joakim@verona.se, emacs-devel@gnu.org, Juri Linkov , 'Dan Nicolaescu' , 'Stefan Monnier' , Drew Adams , 'Miles Bader' To: Leo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 09 18:17:23 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 1MaB5H-00048K-7i for ged-emacs-devel@m.gmane.org; Sun, 09 Aug 2009 18:17:23 +0200 Original-Received: from localhost ([127.0.0.1]:42164 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MaB5G-0000hN-JV for ged-emacs-devel@m.gmane.org; Sun, 09 Aug 2009 12:17:22 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MaB5A-0000fE-VX for emacs-devel@gnu.org; Sun, 09 Aug 2009 12:17:17 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MaB55-0000cL-Ny for emacs-devel@gnu.org; Sun, 09 Aug 2009 12:17:15 -0400 Original-Received: from [199.232.76.173] (port=37397 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MaB55-0000cI-Ir for emacs-devel@gnu.org; Sun, 09 Aug 2009 12:17:11 -0400 Original-Received: from cyd.mit.edu ([18.115.2.24]:57882) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MaB52-0003Wn-R2; Sun, 09 Aug 2009 12:17:08 -0400 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id 8F1B757E21E; Sun, 9 Aug 2009 12:18:01 -0400 (EDT) In-Reply-To: (Leo's message of "Sun, 09 Aug 2009 05:28:21 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:113855 Archived-At: 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 ============