emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: theme and a question about creating them


From: Stefan Monnier
Subject: Re: theme and a question about creating them
Date: Wed, 05 Jan 2011 16:05:09 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

>> (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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]