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: Chong Yidong
Subject: Re: theme and a question about creating them
Date: Sun, 02 Jan 2011 09:16:38 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Dirk-Jan C. Binnema <address@hidden> 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?



reply via email to

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