tags:

views:

176

answers:

1

I aware that when there's a byte compiled version of a .el file (.elc), emacs loads this second one (I currently pacing them in the same directory).

When I start emacs and I look into my Message buffer I see this:

Loading c:/Documents and Settings.../App.../.emacs.d/themes/color-theme-example.el (source)...done
Loading c:/Documents and Setting.../App.../.emacs.d/themes/color-theme-example.elc...done
Loading c:/Documents and Settings.../App.../.emacs.d/themes/color-theme-library.el (source)...done
Loading c:/Documents and Settings.../App.../.emacs.d/themes/color-theme-library.elc...done

Is emacs loading both the .el and .elc version of the same file? I don't want emacs to load my plugins twice.

In my .emacs I loaded something like this:

;;color theme plugin
(add-to-list 'load-path "~/.emacs.d/")
(require 'color-theme)
(eval-after-load "color-theme"
  '(progn
     (color-theme-initialize)
     (color-theme-charcoal-black)))
+2  A: 

Are you loading color-theme using load-file or using require? require will not load a file whose feature has already been provided, only use load-file when you want to explicitly override that. Another possibility is that color-theme-example and color-theme-library are not using provide, so every time they are asked for with require they are being loaded again - but that should print an error ("required feature 'color-theme-example not provided by loaded file" or something similar).

Justin Smith
I'm using this in my .emacs:;;color theme plugin(add-to-list 'load-path "~/.emacs.d/")(require 'color-theme)(eval-after-load "color-theme" '(progn (color-theme-initialize) (color-theme-charcoal-black)))
janoChen
the manual says this about eval-after-load: well-designed Lisp programs should not use this feature. You already required color-theme, just just run the code directly. It looks like your .emacs is fine though, if that is the only relevant code. I would guess that color-theme is using load-file internally, or causing files to be erroneously loaded multiple times in some other manner.
Justin Smith
I just downloaded color-theme-6.6.0, and for some reason it resized my speedbar to be taller than my screen, but otherwise there was no problem using the code you posted here (color-theme-example.el and color-theme-library.el each loaded exactly once).After compiling the color-theme-example and color-theme-library files, they did load both the source and compiled version. This indicates an error in the color-theme code.
Justin Smith
Thanks for the info.
janoChen