From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dirk-Jan C. Binnema Newsgroups: gmane.emacs.devel Subject: Re: theme and a question about creating them Date: Wed, 05 Jan 2011 21:26:02 +0200 Organization: DJCBSoftware Message-ID: <20110105192602.637F339C735@djcbsoftware.nl> References: <20101231155214.DE05339C1EA@djcbsoftware.nl> <87ipy7z8zd.fsf@stupidchicken.com> Reply-To: djcb@djcbsoftware.nl NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: dough.gmane.org 1294255584 26250 80.91.229.12 (5 Jan 2011 19:26:24 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 5 Jan 2011 19:26:24 +0000 (UTC) Cc: emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 05 20:26:19 2011 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.69) (envelope-from ) id 1PaYzx-0004hM-Hh for ged-emacs-devel@m.gmane.org; Wed, 05 Jan 2011 20:26:17 +0100 Original-Received: from localhost ([127.0.0.1]:43056 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PaYzw-0002a7-Ug for ged-emacs-devel@m.gmane.org; Wed, 05 Jan 2011 14:26:16 -0500 Original-Received: from [140.186.70.92] (port=41368 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PaYzs-0002a0-UM for emacs-devel@gnu.org; Wed, 05 Jan 2011 14:26:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PaYzr-00043K-NP for emacs-devel@gnu.org; Wed, 05 Jan 2011 14:26:12 -0500 Original-Received: from vs13.mail.saunalahti.fi ([195.197.172.103]:33476) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PaYzr-00041j-BU for emacs-devel@gnu.org; Wed, 05 Jan 2011 14:26:11 -0500 Original-Received: from saunalahti-vams (localhost [127.0.0.1]) by vs13.mail.saunalahti.fi (Postfix) with SMTP id 6C17D73069; Wed, 5 Jan 2011 21:26:05 +0200 (EET) Original-Received: from vs13.mail.saunalahti.fi ([127.0.0.1]) by vs13.mail.saunalahti.fi ([195.197.172.103]) with SMTP (gateway) id A040C969672; Wed, 05 Jan 2011 21:26:05 +0200 Original-Received: from gw03.mail.saunalahti.fi (gw03.mail.saunalahti.fi [195.197.172.111]) by vs13.mail.saunalahti.fi (Postfix) with ESMTP id 5EED173069; Wed, 5 Jan 2011 21:26:05 +0200 (EET) Original-Received: from djcbsoftware.nl (a88-114-89-247.elisa-laajakaista.fi [88.114.89.247]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by gw03.mail.saunalahti.fi (Postfix) with ESMTP id 22F512166C1; Wed, 5 Jan 2011 21:26:02 +0200 (EET) Original-Received: from cthulhu.mindcrime.djcbsoftware.nl (localhost.localdomain [127.0.0.1]) by djcbsoftware.nl (Postfix) with ESMTP id 637F339C735; Wed, 5 Jan 2011 21:26:02 +0200 (EET) In-Reply-To: <87ipy7z8zd.fsf@stupidchicken.com> Mail-Reply-To: djcb@djcbsoftware.nl User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/24.0 Mule/6.0 (HANACHIRUSATO) X-Antivirus: VAMS X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:134296 Archived-At: Hi, >>>>> On Sun, 2 Jan 2011 09:16:38 -0500, Chong Yidong ("CYD") wrote: >> Dirk-Jan C. Binnema writes: 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? CYD> Currently, the theme loading code is too strict about the forms in the CYD> theme file that it will evaluate. It uses `unsafep' to check the CYD> forms, and (defconst mycolor "#123456") is considered unsafe under the CYD> criteria used by `unsafep'. CYD> I am not sure what's the best way of handling this. Maybe we should CYD> just go back to unconditionally loading theme files, since it's CYD> unlikely we can make evaluating Elisp code truly safe. Any objections CYD> or alternative ideas? I'm fine with that, but I'm hardly qualified to see the implications of this. Somewhat related, I think that emacs should promote the use of :inherit; many modes have their own faces which require way to many customizations (look e.g.. at zenburn which has hundreds of lines). Finally, load-theme seems like a convenient mechanism to set/unset any set of values. I wonder if it could be used (if unconditional loading is enabled) to ship a theme with sets up things in a way that many new users expect, i.e.., with delete-selection-mode, column-number-mode and a couple of other things. Best wishes, Dirk. -- 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