From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: theme and a question about creating them Date: Wed, 05 Jan 2011 16:05:09 -0500 Message-ID: References: <20101231155214.DE05339C1EA@djcbsoftware.nl> <87ipy7z8zd.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1294261538 25269 80.91.229.12 (5 Jan 2011 21:05:38 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 5 Jan 2011 21:05:38 +0000 (UTC) Cc: djcb@djcbsoftware.nl, emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 05 22:05:33 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 1PaaXz-00018L-Ld for ged-emacs-devel@m.gmane.org; Wed, 05 Jan 2011 22:05:31 +0100 Original-Received: from localhost ([127.0.0.1]:42231 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PaaXz-0005s6-5r for ged-emacs-devel@m.gmane.org; Wed, 05 Jan 2011 16:05:31 -0500 Original-Received: from [140.186.70.92] (port=52949 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PaaXu-0005s1-H5 for emacs-devel@gnu.org; Wed, 05 Jan 2011 16:05:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PaaXt-0003vD-6C for emacs-devel@gnu.org; Wed, 05 Jan 2011 16:05:26 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:40393) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PaaXr-0003v7-F2 for emacs-devel@gnu.org; Wed, 05 Jan 2011 16:05:25 -0500 Original-Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id p05L5Ewf013015; Wed, 5 Jan 2011 16:05:14 -0500 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id AE3E2130519; Wed, 5 Jan 2011 16:05:09 -0500 (EST) In-Reply-To: <87ipy7z8zd.fsf@stupidchicken.com> (Chong Yidong's message of "Sun, 02 Jan 2011 09:16:38 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3731=0 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:134300 Archived-At: >> (defconst mycolor "#123456") >> (deftheme mytheme) >> (custom-theme-set-faces 'mytheme >> `(default ((t (:background ,mycolor))))) > 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. How 'bout: (deftheme mytheme) (let ((mycolor "#123456")) (custom-theme-set-faces 'mytheme `(default ((t (:background ,mycolor)))))) > 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? IIUC the problem is that users tend to expect themes to be "just data", without any possible risks, so they may try themes they download from random places on the web. So, I think it's OK to use unsafep to weed out the "safe" themes, and prompt users for the remaining themes. But the prompt should make it clear that we have no determined the theme to be dangerous, just that Emacs did not recognize it as obviously safe and is unable to assess whether it's dangerous or not. Stefan