all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Load color-theme in init.el
@ 2012-07-21 16:12 Patrick Wang
  2012-08-14  2:39 ` nathan.leclaire
  0 siblings, 1 reply; 9+ messages in thread
From: Patrick Wang @ 2012-07-21 16:12 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

I am using emacs 24.1.1 on Mac OS X Lion. I installed color-theme via emacs package and try to load a color theme in init.el. Therefore I added following lines into my init.el

 (require 'color-theme)
 (setq color-theme-is-global t)
 (color-theme-tty-dark)

However, after I restarted emacs, I got an error message "File error: Cannot open load file, color-theme," and color scheme wasn't changed.

It seems that init.el is evaluated before packages are loaded. If I evaluate init.el using "eval-buffer" after emacs is launched, color-theme can be found and color will be changed.

Can anyone give me a hand? Thanks!


Patrick


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Load color-theme in init.el
  2012-07-21 16:12 Load color-theme in init.el Patrick Wang
@ 2012-08-14  2:39 ` nathan.leclaire
  2012-08-14  8:48   ` Peter Dyballa
  0 siblings, 1 reply; 9+ messages in thread
From: nathan.leclaire @ 2012-08-14  2:39 UTC (permalink / raw)
  To: help-gnu-emacs

On Saturday, July 21, 2012 12:12:17 PM UTC-4, Patrick Wang wrote:
> Hi,
> 
> 
> 
> I am using emacs 24.1.1 on Mac OS X Lion. I installed color-theme via emacs package and try to load a color theme in init.el. Therefore I added following lines into my init.el
> 
> 
> 
>  (require 'color-theme)
> 
>  (setq color-theme-is-global t)
> 
>  (color-theme-tty-dark)
> 
> 
> 
> However, after I restarted emacs, I got an error message "File error: Cannot open load file, color-theme," and color scheme wasn't changed.
> 
> 
> 
> It seems that init.el is evaluated before packages are loaded. If I evaluate init.el using "eval-buffer" after emacs is launched, color-theme can be found and color will be changed.
> 
> 
> 
> Can anyone give me a hand? Thanks!
> 
> 
> 
> 
> 
> Patrick

Patrick, did you ever figure out the solution to this problem?  I am having the same issue.  M - x eval-buffer works great for my .emacs file but it won't load regularly.

Thanks,

Nathan


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Load color-theme in init.el
  2012-08-14  2:39 ` nathan.leclaire
@ 2012-08-14  8:48   ` Peter Dyballa
  2012-08-15  0:30     ` Nathan LeClaire
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Dyballa @ 2012-08-14  8:48 UTC (permalink / raw)
  To: nathan.leclaire, Patrick Wang; +Cc: help-gnu-emacs


Am 14.08.2012 um 04:39 schrieb nathan.leclaire:

>> It seems that init.el is evaluated before packages are loaded.

What is this file "init.el"? Is it the (C-h v) site-run-file? If so, then it's the wrong place for the purpose of setting a colour theme. It might be OK to load here the Elisp code to handle colour themes, i.e., (require 'color-theme).

	The run-time load order is: 1. file described in
	this variable, if non-nil; 2. `~/.emacs'; 3. `default.el'.

When you look up the documentation of site-run-file you'll find some more hints.

The file "~/.emacs" is named by the variable user-init-file.

--
Greetings

  Pete     === -Q
             ==<__/% >>
_____________(_)____@_____________________________




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Load color-theme in init.el
  2012-08-14  8:48   ` Peter Dyballa
@ 2012-08-15  0:30     ` Nathan LeClaire
  2012-08-15  1:23       ` Drew Adams
  0 siblings, 1 reply; 9+ messages in thread
From: Nathan LeClaire @ 2012-08-15  0:30 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: Patrick Wang, help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

Hi guys, thanks for replying.  If anyone out there is still searching, I
finally figured out that apparently in Emacs 24 color-theme is (slightly?)
deprecated.  Instead you can load color themes with M - x load-theme, which
provides a bunch of choices.  I enjoy wombat, myself.  I'm using Emacs 24
for OS X.

Cheers,

Nathan

On Tue, Aug 14, 2012 at 4:48 AM, Peter Dyballa <Peter_Dyballa@web.de> wrote:

>
> Am 14.08.2012 um 04:39 schrieb nathan.leclaire:
>
> >> It seems that init.el is evaluated before packages are loaded.
>
> What is this file "init.el"? Is it the (C-h v) site-run-file? If so, then
> it's the wrong place for the purpose of setting a colour theme. It might be
> OK to load here the Elisp code to handle colour themes, i.e., (require
> 'color-theme).
>
>         The run-time load order is: 1. file described in
>         this variable, if non-nil; 2. `~/.emacs'; 3. `default.el'.
>
> When you look up the documentation of site-run-file you'll find some more
> hints.
>
> The file "~/.emacs" is named by the variable user-init-file.
>
> --
> Greetings
>
>   Pete     === -Q
>              ==<__/% >>
> _____________(_)____@_____________________________
>
>

[-- Attachment #2: Type: text/html, Size: 1735 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: Load color-theme in init.el
  2012-08-15  0:30     ` Nathan LeClaire
@ 2012-08-15  1:23       ` Drew Adams
  2012-08-15 13:26         ` Nathan LeClaire
  2012-08-15 20:37         ` Suvayu Ali
  0 siblings, 2 replies; 9+ messages in thread
From: Drew Adams @ 2012-08-15  1:23 UTC (permalink / raw)
  To: 'Nathan LeClaire', 'Peter Dyballa'
  Cc: 'Patrick Wang', help-gnu-emacs

> Hi guys, thanks for replying.  If anyone out there is still
> searching, I finally figured out that apparently in Emacs 24
> color-theme is (slightly?) deprecated.

No, color-theme is not at all deprecated.  It has never been part of GNU Emacs,
so GNU Emacs cannot deprecate it.  It is a third-party library, color-theme.el,
and it is still available AFAIK.

What is unfortunate is that GNU Emacs adopted a name, "custom theme", that is so
close to "color theme", which already has a certain following.

Every few weeks someone posts here with questions that involve confusion between
the two.

(Emacs has had "custom themes" for a long time, but until Emacs 24 they had
nothing to do with colors (as in "color theme").  It is the combination of Emacs
24 adopting something similar to what color-theme.el offers plus its inclusion
of that new feature in the grab bag called "custom themes" that seems to lead to
the confusion.)




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Load color-theme in init.el
  2012-08-15  1:23       ` Drew Adams
@ 2012-08-15 13:26         ` Nathan LeClaire
  2012-08-15 14:03           ` Drew Adams
  2012-08-15 20:37         ` Suvayu Ali
  1 sibling, 1 reply; 9+ messages in thread
From: Nathan LeClaire @ 2012-08-15 13:26 UTC (permalink / raw)
  To: Drew Adams; +Cc: help-gnu-emacs, Patrick Wang

[-- Attachment #1: Type: text/plain, Size: 1442 bytes --]

I see.  Thanks for clarifying.  In my original e-mail I also forgot to
mention that the advice of Peter Dyballa to use a .emacs for customization
was the correct advice.  Thanks Peter.  I got the idea to use
~/.emacs/init.el from the Emacs Starter Kit (
https://github.com/technomancy/emacs-starter-kit/ ).  Presumably it is no
substitute for .emacs.

Thanks again everyone,

Nathan

On Tue, Aug 14, 2012 at 8:23 PM, Drew Adams <drew.adams@oracle.com> wrote:

> > Hi guys, thanks for replying.  If anyone out there is still
> > searching, I finally figured out that apparently in Emacs 24
> > color-theme is (slightly?) deprecated.
>
> No, color-theme is not at all deprecated.  It has never been part of GNU
> Emacs,
> so GNU Emacs cannot deprecate it.  It is a third-party library,
> color-theme.el,
> and it is still available AFAIK.
>
> What is unfortunate is that GNU Emacs adopted a name, "custom theme", that
> is so
> close to "color theme", which already has a certain following.
>
> Every few weeks someone posts here with questions that involve confusion
> between
> the two.
>
> (Emacs has had "custom themes" for a long time, but until Emacs 24 they had
> nothing to do with colors (as in "color theme").  It is the combination of
> Emacs
> 24 adopting something similar to what color-theme.el offers plus its
> inclusion
> of that new feature in the grab bag called "custom themes" that seems to
> lead to
> the confusion.)
>
>

[-- Attachment #2: Type: text/html, Size: 1937 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: Load color-theme in init.el
  2012-08-15 13:26         ` Nathan LeClaire
@ 2012-08-15 14:03           ` Drew Adams
  0 siblings, 0 replies; 9+ messages in thread
From: Drew Adams @ 2012-08-15 14:03 UTC (permalink / raw)
  To: 'Nathan LeClaire'; +Cc: help-gnu-emacs, 'Patrick Wang'

> I see.  Thanks for clarifying.  In my original e-mail I
> also forgot to mention that the advice of Peter Dyballa
> to use a .emacs for customization was the correct advice.
> Thanks Peter.  I got the idea to use ~/.emacs/init.el...

My advice is to use a separate file, the value of user option `custom-file', for
customizations that are written automatically when you use Customize (e.g., `M-x
customize-option').

That keeps such generated code away from any code that you write in your init
file (~/.emacs).  Let Customize fiddle with `custom-file', and keep your init
file for your own fiddlings.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Load color-theme in init.el
  2012-08-15  1:23       ` Drew Adams
  2012-08-15 13:26         ` Nathan LeClaire
@ 2012-08-15 20:37         ` Suvayu Ali
  2012-08-15 21:18           ` Drew Adams
  1 sibling, 1 reply; 9+ messages in thread
From: Suvayu Ali @ 2012-08-15 20:37 UTC (permalink / raw)
  To: Drew Adams
  Cc: help-gnu-emacs, 'Patrick Wang', 'Nathan LeClaire'

Hello Drew,

On Tue, Aug 14, 2012 at 06:23:02PM -0700, Drew Adams wrote:
> > Hi guys, thanks for replying.  If anyone out there is still
> > searching, I finally figured out that apparently in Emacs 24
> > color-theme is (slightly?) deprecated.
>
> No, color-theme is not at all deprecated.  It has never been part of GNU Emacs,
> so GNU Emacs cannot deprecate it.  It is a third-party library, color-theme.el,
> and it is still available AFAIK.
>

I believe starting with the following commit:

  commit 2faa2c5d69f36c29cdd3b654f4cc9c4b89c81e5a
  Author: Chong Yidong <cyd@gnu.org>
  Date:   Mon Apr 23 02:04:54 2012 +0800

      * faces.el (face-spec-set): Stop supporting deprecated form of
        third arg.

color-theme stopped working properly with Emacs 24.  I switched to
custom-theme soon after, so I don't know if the situation has changed.

Cheers,

--
Suvayu

Open source is the future. It sets us free.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: Load color-theme in init.el
  2012-08-15 20:37         ` Suvayu Ali
@ 2012-08-15 21:18           ` Drew Adams
  0 siblings, 0 replies; 9+ messages in thread
From: Drew Adams @ 2012-08-15 21:18 UTC (permalink / raw)
  To: 'Suvayu Ali'
  Cc: help-gnu-emacs, 'Patrick Wang', 'Nathan LeClaire'

> > > I finally figured out that apparently in Emacs 24
> > > color-theme is (slightly?) deprecated.
> >
> > No, color-theme is not at all deprecated.  It has never 
> > been part of GNU Emacs, so GNU Emacs cannot deprecate it.
> > It is a third-party library, color-theme.el, and it is still
> > available AFAIK.
>
> I believe starting with the following commit:
>
>   commit 2faa2c5d69f36c29cdd3b654f4cc9c4b89c81e5a
>   Author: Chong Yidong <cyd@gnu.org>
>   Date:   Mon Apr 23 02:04:54 2012 +0800
>       * faces.el (face-spec-set): Stop supporting deprecated
>         form of third arg.
> 
> color-theme stopped working properly with Emacs 24.  I switched to
> custom-theme soon after, so I don't know if the situation has changed.

OK, good to know, I guess.  You are reporting that color-theme.el no longer
works with GNU Emacs.  Sorry to hear that.  I was reporting only that (a) GNU
Emacs cannot deprecate color-theme.el (by definition) and (b) color-theme.el is
still available.

But it should be straightforward to update color-theme.el to no longer use
`face-spec-set' (said without bothering to look at the code), should anyone want
to do that.  It should be enough to use `face-set-attribute' (and perhaps
`face-spec-chooose'), to replace using `face-spec-set'.

Of course, there is no guarantee that with just that change color-theme.el will
work with Emacs 24.

On n'arrete pas le progres...




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-08-15 21:18 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-21 16:12 Load color-theme in init.el Patrick Wang
2012-08-14  2:39 ` nathan.leclaire
2012-08-14  8:48   ` Peter Dyballa
2012-08-15  0:30     ` Nathan LeClaire
2012-08-15  1:23       ` Drew Adams
2012-08-15 13:26         ` Nathan LeClaire
2012-08-15 14:03           ` Drew Adams
2012-08-15 20:37         ` Suvayu Ali
2012-08-15 21:18           ` Drew Adams

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.