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: theme and a question about creating them Date: Sun, 02 Jan 2011 09:16:38 -0500 Message-ID: <87ipy7z8zd.fsf@stupidchicken.com> References: <20101231155214.DE05339C1EA@djcbsoftware.nl> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1293977822 17785 80.91.229.12 (2 Jan 2011 14:17:02 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 2 Jan 2011 14:17:02 +0000 (UTC) Cc: emacs-devel@gnu.org To: djcb@djcbsoftware.nl Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 02 15:16:58 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 1PZOjx-00043m-Mr for ged-emacs-devel@m.gmane.org; Sun, 02 Jan 2011 15:16:57 +0100 Original-Received: from localhost ([127.0.0.1]:41195 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PZOjw-0000rA-Rm for ged-emacs-devel@m.gmane.org; Sun, 02 Jan 2011 09:16:56 -0500 Original-Received: from [140.186.70.92] (port=45187 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PZOjl-0000gr-3M for emacs-devel@gnu.org; Sun, 02 Jan 2011 09:16:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PZOjk-0005l8-22 for emacs-devel@gnu.org; Sun, 02 Jan 2011 09:16:45 -0500 Original-Received: from vm-emlprdomr-04.its.yale.edu ([130.132.50.145]:58130) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PZOjj-0005l3-Qf for emacs-devel@gnu.org; Sun, 02 Jan 2011 09:16:44 -0500 Original-Received: from furball (dhcp128036014085.central.yale.edu [128.36.14.85]) (authenticated bits=0) by vm-emlprdomr-04.its.yale.edu (8.14.4/8.14.4) with ESMTP id p02EGc8m012569 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 2 Jan 2011 09:16:39 -0500 Original-Received: by furball (Postfix, from userid 1000) id 74623161DD7; Sun, 2 Jan 2011 09:16:38 -0500 (EST) In-Reply-To: <20101231155214.DE05339C1EA@djcbsoftware.nl> (Dirk-Jan C. Binnema's message of "Fri, 31 Dec 2010 17:52:14 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Scanned-By: MIMEDefang 2.71 on 130.132.50.145 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:134166 Archived-At: 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? Currently, the theme loading code is too strict about the forms in the theme file that it will evaluate. It uses `unsafep' to check the forms, and (defconst mycolor "#123456") is considered unsafe under the criteria used by `unsafep'. I am not sure what's the best way of handling this. Maybe we should just go back to unconditionally loading theme files, since it's unlikely we can make evaluating Elisp code truly safe. Any objections or alternative ideas?