From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Newsgroups: gmane.emacs.devel Subject: Re: Color themes Date: Mon, 10 Aug 2009 10:12:38 +0100 Message-ID: <20a0c1020908100212p32dd463ao8a9a33d7edbf960f@mail.gmail.com> References: <87d47hoox5.fsf@stupidchicken.com> <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=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1249895589 32703 80.91.229.12 (10 Aug 2009 09:13:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 10 Aug 2009 09:13:09 +0000 (UTC) Cc: David De La Harpe Golden , Lennart Borgman , joakim@verona.se, 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 Mon Aug 10 11:13:01 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 1MaQw6-00065G-Em for ged-emacs-devel@m.gmane.org; Mon, 10 Aug 2009 11:12:58 +0200 Original-Received: from localhost ([127.0.0.1]:36907 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MaQw5-0001Jm-CY for ged-emacs-devel@m.gmane.org; Mon, 10 Aug 2009 05:12:57 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MaQvw-0001Jh-QJ for emacs-devel@gnu.org; Mon, 10 Aug 2009 05:12:48 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MaQvr-0001JP-Q0 for emacs-devel@gnu.org; Mon, 10 Aug 2009 05:12:47 -0400 Original-Received: from [199.232.76.173] (port=38317 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MaQvr-0001J3-Hm for emacs-devel@gnu.org; Mon, 10 Aug 2009 05:12:43 -0400 Original-Received: from mail-bw0-f222.google.com ([209.85.218.222]:59228) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MaQvo-0006c8-8r; Mon, 10 Aug 2009 05:12:40 -0400 Original-Received: by bwz22 with SMTP id 22so2671514bwz.42 for ; Mon, 10 Aug 2009 02:12:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=dORVZFnmSrt32gURdsQqXCWK50gr7/g1ISvKvYPN7ho=; b=G+KgWrbeoWii0EqlvNvzzj3SzQwigZZdEh3og9kzcKL9iPlFheXABjF3//gN6XF8hg tvM8rjgRe/7OSM2+wrrptpyNtd//udRNQO+D1EW/PA8jwRNbiot9GQrrI3oZdKjCJtlH gOMNfMoMfJb6KIkYC7yrQl41ubKxmCxeOJ1/8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=tgj0Yc1awO8s7dhYRhgEK1qaYpwJOdAWYJa/Pczz3P8wuyi0YAkenuWxyiV/JUhe3T 6Qciphn0JDlIvdf/yR+oZvTv5naN7xOGGhsQxb1hdgHLWospuqEzLt9fJ+ZVpsKlLUbj Lu0V+r+L5B2YuK+v5ffKJYH6OFNWu4oBeA2+g= Original-Received: by 10.103.214.13 with SMTP id r13mr856819muq.7.1249895558153; Mon, 10 Aug 2009 02:12:38 -0700 (PDT) In-Reply-To: <874oshx8p2.fsf@cyd.mit.edu> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:113954 Archived-At: 2009/8/9 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 ============ Thank you Chong. I failed to see how consistency can be reached through this. For example, if a package define faces that do not inherit from the faces in the theme, then enabling the theme won't affect them, right? I am thinking about if each buffer is an icon, how to make sure they look like, for example, tango by using the 28 colors in its style guide only. Leo