[Top][All Lists]

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

Re: theme and a question about creating them

From: Dirk-Jan C . Binnema
Subject: Re: theme and a question about creating them
Date: Wed, 05 Jan 2011 21:26:02 +0200
User-agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/24.0 Mule/6.0 (HANACHIRUSATO)


>>>>> On Sun, 2 Jan 2011 09:16:38 -0500, Chong Yidong ("CYD") wrote:

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

  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

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-Jan C. Binnema                  Helsinki, Finland
e:address@hidden           w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C

reply via email to

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