From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: joakim@verona.se Newsgroups: gmane.emacs.devel Subject: Re: Color themes Date: Sun, 09 Aug 2009 20:51:03 +0200 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; charset=us-ascii X-Trace: ger.gmane.org 1249843910 17855 80.91.229.12 (9 Aug 2009 18:51:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 9 Aug 2009 18:51:50 +0000 (UTC) Cc: 'David De La Harpe Golden' , 'Lennart Borgman' , emacs-devel@gnu.org, Juri Linkov , 'Dan Nicolaescu' , 'Stefan Monnier' , Leo , Drew Adams , 'Miles Bader' To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 09 20:51:41 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 1MaDUZ-0001TC-ME for ged-emacs-devel@m.gmane.org; Sun, 09 Aug 2009 20:51:40 +0200 Original-Received: from localhost ([127.0.0.1]:54006 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MaDUZ-0003pD-0Z for ged-emacs-devel@m.gmane.org; Sun, 09 Aug 2009 14:51:39 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MaDUB-0003oB-9b for emacs-devel@gnu.org; Sun, 09 Aug 2009 14:51:15 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MaDU6-0003my-5M for emacs-devel@gnu.org; Sun, 09 Aug 2009 14:51:14 -0400 Original-Received: from [199.232.76.173] (port=47803 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MaDU5-0003mv-Vm for emacs-devel@gnu.org; Sun, 09 Aug 2009 14:51:10 -0400 Original-Received: from iwfs.imcode.com ([82.115.149.64]:39675 helo=gate.verona.se) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MaDU3-0004pJ-8U; Sun, 09 Aug 2009 14:51:07 -0400 Original-Received: from localhost.localdomain (IDENT:1005@localhost [127.0.0.1]) by gate.verona.se (8.13.4/8.11.4) with ESMTP id n79Ip2pR016198; Sun, 9 Aug 2009 20:51:02 +0200 In-Reply-To: <874oshx8p2.fsf@cyd.mit.edu> (Chong Yidong's message of "Sun, 09 Aug 2009 12:18:01 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 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:113873 Archived-At: Chong Yidong writes: > 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. While I havent tested this, it seems great! Can we somehow create a machine translator from color-theme.el to custom-theme? > > > ======= 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 ============ > -- Joakim Verona